From bab94346dac53320f9847a022374cc7959ec366e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 Jun 2026 17:16:36 +0000 Subject: [PATCH] docs: clarified OUTPUT_AUDIO_ENCODING_MP3 feat: added support for new AnswerType types feat: added support for SIP config in conversation profile feat: added support for proactive and reactive in CES app feat: added support for new knowledge suggestion PiperOrigin-RevId: 934361904 Source-Link: https://github.com/googleapis/googleapis/commit/f548abb6c8d16b0895dcb4ea2391e10e20fba4a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/031ded3348221c7a63cc2945dda82cfe4f37e1e1 Copy-Tag: eyJwIjoiRGlhbG9nZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiMDMxZGVkMzM0ODIyMWM3YTYzY2MyOTQ1ZGRhODJjZmU0ZjM3ZTFlMSJ9 --- .../Google/Cloud/Dialogflow/V2/Agent.php | 33 + .../V2/AgentCoachingInstruction.php | 25 + .../Cloud/Dialogflow/V2/AnswerRecord.php | 32 + .../Cloud/Dialogflow/V2/AudioConfig.php | 27 + .../Google/Cloud/Dialogflow/V2/CesApp.php | 27 + .../Google/Cloud/Dialogflow/V2/CesTool.php | 27 + .../Google/Cloud/Dialogflow/V2/Context.php | 31 + .../Cloud/Dialogflow/V2/Conversation.php | 34 + .../Dialogflow/V2/ConversationDataset.php | 33 + .../Cloud/Dialogflow/V2/ConversationEvent.php | 29 + .../Cloud/Dialogflow/V2/ConversationModel.php | 31 + .../Dialogflow/V2/ConversationProfile.php | 36 + .../Google/Cloud/Dialogflow/V2/Document.php | 34 + .../Cloud/Dialogflow/V2/EncryptionSpec.php | 29 + .../Google/Cloud/Dialogflow/V2/EntityType.php | 32 + .../Cloud/Dialogflow/V2/Environment.php | 33 + .../Cloud/Dialogflow/V2/Fulfillment.php | 29 + .../Google/Cloud/Dialogflow/V2/Gcs.php | 25 + .../Google/Cloud/Dialogflow/V2/Generator.php | 36 + .../Dialogflow/V2/GeneratorEvaluation.php | 34 + .../V2/HumanAgentAssistantEvent.php | 25 + .../Google/Cloud/Dialogflow/V2/Intent.php | 33 + .../Cloud/Dialogflow/V2/KnowledgeBase.php | 30 + .../Google/Cloud/Dialogflow/V2/Operations.php | 26 + .../Cloud/Dialogflow/V2/Participant.php | 35 + .../Google/Cloud/Dialogflow/V2/Session.php | 37 + .../Cloud/Dialogflow/V2/SessionEntityType.php | 31 + .../Google/Cloud/Dialogflow/V2/SipTrunk.php | 31 + .../Google/Cloud/Dialogflow/V2/Tool.php | 32 + .../Google/Cloud/Dialogflow/V2/ToolCall.php | 28 + .../Google/Cloud/Dialogflow/V2/Toolset.php | 27 + .../Cloud/Dialogflow/V2/ValidationResult.php | 24 + .../Google/Cloud/Dialogflow/V2/Version.php | 31 + .../Google/Cloud/Dialogflow/V2/Webhook.php | 30 + .../src/Google/Cloud/Dialogflow/V2/Agent.php | 543 +++++++ .../Cloud/Dialogflow/V2/Agent/ApiVersion.php | 68 + .../Cloud/Dialogflow/V2/Agent/MatchMode.php | 63 + .../Google/Cloud/Dialogflow/V2/Agent/Tier.php | 69 + .../Dialogflow/V2/AgentAssistantFeedback.php | 331 +++++ .../AnswerRelevance.php | 61 + .../DocumentCorrectness.php | 61 + .../DocumentEfficiency.php | 61 + .../KnowledgeAssistFeedback.php | 129 ++ .../KnowledgeSearchFeedback.php | 129 ++ .../SummarizationFeedback.php | 189 +++ .../Dialogflow/V2/AgentAssistantRecord.php | 174 +++ .../Dialogflow/V2/AgentCoachingContext.php | 177 +++ .../V2/AgentCoachingInstruction.php | 317 +++++ .../DuplicateCheckResult.php | 67 + .../DuplicateSuggestion.php | 143 ++ .../AgentCoachingInstruction/TriggerEvent.php | 82 ++ .../Dialogflow/V2/AgentCoachingSuggestion.php | 135 ++ .../AgentActionSuggestion.php | 155 ++ .../DuplicateCheckResult.php | 67 + .../DuplicateSuggestion.php | 189 +++ .../SampleResponse.php | 156 ++ .../V2/AgentCoachingSuggestion/Sources.php | 71 + .../Dialogflow/V2/AnalyzeContentRequest.php | 521 +++++++ .../Dialogflow/V2/AnalyzeContentResponse.php | 432 ++++++ .../Dialogflow/V2/AnnotatedMessagePart.php | 195 +++ .../Cloud/Dialogflow/V2/AnswerFeedback.php | 282 ++++ .../V2/AnswerFeedback/CorrectnessLevel.php | 68 + .../Cloud/Dialogflow/V2/AnswerRecord.php | 190 +++ .../Cloud/Dialogflow/V2/ArticleAnswer.php | 261 ++++ .../V2/ArticleSuggestionModelMetadata.php | 71 + .../Dialogflow/V2/AssistQueryParameters.php | 131 ++ .../Cloud/Dialogflow/V2/AudioEncoding.php | 125 ++ .../Google/Cloud/Dialogflow/V2/AudioInput.php | 123 ++ .../Dialogflow/V2/AutomatedAgentConfig.php | 175 +++ .../Dialogflow/V2/AutomatedAgentReply.php | 203 +++ .../AutomatedAgentReplyType.php | 67 + .../V2/BatchCreateEntitiesRequest.php | 196 +++ .../V2/BatchDeleteEntitiesRequest.php | 208 +++ .../V2/BatchDeleteEntityTypesRequest.php | 128 ++ .../V2/BatchDeleteIntentsRequest.php | 128 ++ .../V2/BatchUpdateEntitiesRequest.php | 240 ++++ .../V2/BatchUpdateEntityTypesRequest.php | 250 ++++ .../V2/BatchUpdateEntityTypesResponse.php | 68 + .../V2/BatchUpdateIntentsRequest.php | 314 ++++ .../V2/BatchUpdateIntentsResponse.php | 68 + .../Google/Cloud/Dialogflow/V2/CesAppSpec.php | 217 +++ .../Cloud/Dialogflow/V2/CesToolSpec.php | 105 ++ ...ggestionFeatureConfigOperationMetadata.php | 193 +++ .../ClearSuggestionFeatureConfigRequest.php | 185 +++ .../V2/CloudConversationDebuggingInfo.php | 750 ++++++++++ .../V2/CompleteConversationRequest.php | 92 ++ .../Google/Cloud/Dialogflow/V2/Connection.php | 193 +++ .../V2/Connection/CertificateState.php | 103 ++ .../Dialogflow/V2/Connection/ErrorDetails.php | 121 ++ .../Cloud/Dialogflow/V2/Connection/State.php | 75 + .../Google/Cloud/Dialogflow/V2/Context.php | 261 ++++ .../Cloud/Dialogflow/V2/Conversation.php | 548 +++++++ .../V2/Conversation/ContextReference.php | 183 +++ .../ContextReference/ContextContent.php | 195 +++ .../ContextContent/ContentFormat.php | 61 + .../ContextReference/UpdateMode.php | 61 + .../V2/Conversation/ConversationStage.php | 66 + .../V2/Conversation/GeneratorContext.php | 67 + .../GeneratorContext/GeneratorType.php | 89 ++ .../V2/Conversation/LifecycleState.php | 61 + .../Conversation/TelephonyConnectionInfo.php | 178 +++ .../TelephonyConnectionInfo/MimeContent.php | 101 ++ .../TelephonyConnectionInfo/SipHeader.php | 101 ++ .../Dialogflow/V2/ConversationContext.php | 67 + .../Dialogflow/V2/ConversationDataset.php | 412 ++++++ .../Cloud/Dialogflow/V2/ConversationEvent.php | 233 +++ .../Dialogflow/V2/ConversationEvent/Type.php | 105 ++ .../Cloud/Dialogflow/V2/ConversationInfo.php | 75 + .../Cloud/Dialogflow/V2/ConversationModel.php | 442 ++++++ .../V2/ConversationModel/ModelType.php | 61 + .../Dialogflow/V2/ConversationModel/State.php | 105 ++ .../V2/ConversationModelEvaluation.php | 329 +++++ .../Dialogflow/V2/ConversationPhoneNumber.php | 102 ++ .../Dialogflow/V2/ConversationProfile.php | 823 +++++++++++ .../Dialogflow/V2/CreateContextRequest.php | 153 ++ ...teConversationDatasetOperationMetadata.php | 75 + .../V2/CreateConversationDatasetRequest.php | 132 ++ ...sationModelEvaluationOperationMetadata.php | 201 +++ .../State.php | 82 ++ ...eateConversationModelEvaluationRequest.php | 138 ++ ...eateConversationModelOperationMetadata.php | 199 +++ .../State.php | 91 ++ .../V2/CreateConversationModelRequest.php | 132 ++ .../V2/CreateConversationProfileRequest.php | 133 ++ .../V2/CreateConversationRequest.php | 199 +++ .../Dialogflow/V2/CreateDocumentRequest.php | 138 ++ .../Dialogflow/V2/CreateEntityTypeRequest.php | 206 +++ .../V2/CreateEnvironmentRequest.php | 158 +++ .../V2/CreateGeneratorEvaluationRequest.php | 132 ++ .../Dialogflow/V2/CreateGeneratorRequest.php | 209 +++ .../Dialogflow/V2/CreateIntentRequest.php | 240 ++++ .../V2/CreateKnowledgeBaseRequest.php | 133 ++ .../V2/CreateParticipantRequest.php | 138 ++ .../V2/CreateSessionEntityTypeRequest.php | 153 ++ .../Dialogflow/V2/CreateSipTrunkRequest.php | 133 ++ .../Cloud/Dialogflow/V2/CreateToolRequest.php | 209 +++ .../Dialogflow/V2/CreateVersionRequest.php | 144 ++ .../V2/CustomPronunciationParams.php | 147 ++ .../PhoneticEncoding.php | 63 + .../Dialogflow/V2/DatastoreResponseReason.php | 111 ++ .../Dialogflow/V2/DeleteAgentRequest.php | 87 ++ .../V2/DeleteAllContextsRequest.php | 107 ++ .../Dialogflow/V2/DeleteContextRequest.php | 107 ++ ...teConversationDatasetOperationMetadata.php | 33 + .../V2/DeleteConversationDatasetRequest.php | 92 ++ ...leteConversationModelOperationMetadata.php | 165 +++ .../V2/DeleteConversationModelRequest.php | 86 ++ .../V2/DeleteConversationProfileRequest.php | 94 ++ .../Dialogflow/V2/DeleteDocumentRequest.php | 92 ++ .../Dialogflow/V2/DeleteEntityTypeRequest.php | 87 ++ .../V2/DeleteEnvironmentRequest.php | 88 ++ .../V2/DeleteGeneratorEvaluationRequest.php | 91 ++ .../Dialogflow/V2/DeleteGeneratorRequest.php | 86 ++ .../Dialogflow/V2/DeleteIntentRequest.php | 92 ++ .../V2/DeleteKnowledgeBaseRequest.php | 130 ++ .../V2/DeleteSessionEntityTypeRequest.php | 112 ++ .../Dialogflow/V2/DeleteSipTrunkRequest.php | 92 ++ .../Cloud/Dialogflow/V2/DeleteToolRequest.php | 86 ++ .../Dialogflow/V2/DeleteVersionRequest.php | 103 ++ ...ployConversationModelOperationMetadata.php | 165 +++ .../V2/DeployConversationModelRequest.php | 72 + .../Dialogflow/V2/DetectIntentRequest.php | 428 ++++++ .../Dialogflow/V2/DetectIntentResponse.php | 273 ++++ .../Dialogflow/V2/DialogflowAssistAnswer.php | 150 ++ .../Google/Cloud/Dialogflow/V2/Document.php | 500 +++++++ .../Dialogflow/V2/Document/KnowledgeType.php | 82 ++ .../Dialogflow/V2/Document/ReloadStatus.php | 129 ++ .../Cloud/Dialogflow/V2/Document/State.php | 82 ++ .../Cloud/Dialogflow/V2/DtmfParameters.php | 67 + .../Cloud/Dialogflow/V2/EncryptionSpec.php | 126 ++ .../Google/Cloud/Dialogflow/V2/EntityType.php | 274 ++++ .../V2/EntityType/AutoExpansionMode.php | 57 + .../Cloud/Dialogflow/V2/EntityType/Entity.php | 145 ++ .../Cloud/Dialogflow/V2/EntityType/Kind.php | 72 + .../Cloud/Dialogflow/V2/EntityTypeBatch.php | 67 + .../Cloud/Dialogflow/V2/Environment.php | 362 +++++ .../Cloud/Dialogflow/V2/Environment/State.php | 72 + .../Dialogflow/V2/EnvironmentHistory.php | 164 +++ .../V2/EnvironmentHistory/Entry.php | 145 ++ .../Cloud/Dialogflow/V2/EvaluationConfig.php | 142 ++ .../EvaluationConfig/SmartComposeConfig.php | 121 ++ .../V2/EvaluationConfig/SmartReplyConfig.php | 121 ++ .../Cloud/Dialogflow/V2/EvaluationStatus.php | 133 ++ .../Google/Cloud/Dialogflow/V2/EventInput.php | 221 +++ .../Dialogflow/V2/ExportAgentRequest.php | 153 ++ .../Dialogflow/V2/ExportAgentResponse.php | 112 ++ .../Dialogflow/V2/ExportDocumentRequest.php | 194 +++ .../Dialogflow/V2/ExportOperationMetadata.php | 77 + .../Google/Cloud/Dialogflow/V2/FaqAnswer.php | 269 ++++ .../Cloud/Dialogflow/V2/FewShotExample.php | 206 +++ .../Cloud/Dialogflow/V2/FreeFormContext.php | 67 + .../Dialogflow/V2/FreeFormSuggestion.php | 67 + .../Cloud/Dialogflow/V2/Fulfillment.php | 247 ++++ .../Dialogflow/V2/Fulfillment/Feature.php | 67 + .../V2/Fulfillment/Feature/Type.php | 54 + .../V2/Fulfillment/GenericWebService.php | 235 +++ .../Cloud/Dialogflow/V2/GcsDestination.php | 83 ++ .../Google/Cloud/Dialogflow/V2/GcsSources.php | 75 + .../V2/GenerateStatelessSuggestionRequest.php | 339 +++++ .../GenerateStatelessSuggestionResponse.php | 78 + .../V2/GenerateStatelessSummaryRequest.php | 222 +++ .../MinimalConversation.php | 122 ++ .../V2/GenerateStatelessSummaryResponse.php | 174 +++ .../Summary.php | 147 ++ .../V2/GenerateSuggestionsRequest.php | 183 +++ .../V2/GenerateSuggestionsResponse.php | 114 ++ .../GeneratorSuggestionAnswer.php | 157 ++ .../Google/Cloud/Dialogflow/V2/Generator.php | 625 ++++++++ .../Dialogflow/V2/GeneratorEvaluation.php | 503 +++++++ .../V2/GeneratorEvaluationConfig.php | 165 +++ .../AgentAssistInputDataConfig.php | 130 ++ .../DatasetInputDataConfig.php | 75 + .../InputDataConfig.php | 379 +++++ .../SummaryGenerationOption.php | 68 + .../InputDataSourceType.php | 65 + .../SummarizationConfig.php | 249 ++++ .../GeneratorEvaluationOperationMetadata.php | 77 + .../Dialogflow/V2/GeneratorSuggestion.php | 175 +++ .../V2/GeneratorSuggestion/ToolCallInfo.php | 121 ++ .../Cloud/Dialogflow/V2/GetAgentRequest.php | 87 ++ .../Cloud/Dialogflow/V2/GetContextRequest.php | 107 ++ .../V2/GetConversationDatasetRequest.php | 92 ++ .../GetConversationModelEvaluationRequest.php | 91 ++ .../V2/GetConversationModelRequest.php | 86 ++ .../V2/GetConversationProfileRequest.php | 92 ++ .../Dialogflow/V2/GetConversationRequest.php | 92 ++ .../Dialogflow/V2/GetDocumentRequest.php | 92 ++ .../V2/GetEncryptionSpecRequest.php | 81 ++ .../Dialogflow/V2/GetEntityTypeRequest.php | 158 +++ .../V2/GetEnvironmentHistoryRequest.php | 160 +++ .../Dialogflow/V2/GetEnvironmentRequest.php | 88 ++ .../Dialogflow/V2/GetFulfillmentRequest.php | 87 ++ .../V2/GetGeneratorEvaluationRequest.php | 91 ++ .../Dialogflow/V2/GetGeneratorRequest.php | 86 ++ .../Cloud/Dialogflow/V2/GetIntentRequest.php | 192 +++ .../Dialogflow/V2/GetKnowledgeBaseRequest.php | 92 ++ .../Dialogflow/V2/GetParticipantRequest.php | 92 ++ .../V2/GetSessionEntityTypeRequest.php | 112 ++ .../Dialogflow/V2/GetSipTrunkRequest.php | 92 ++ .../Cloud/Dialogflow/V2/GetToolRequest.php | 86 ++ .../V2/GetValidationResultRequest.php | 122 ++ .../Cloud/Dialogflow/V2/GetVersionRequest.php | 103 ++ .../V2/HumanAgentAssistantConfig.php | 217 +++ .../ConversationModelConfig.php | 135 ++ .../ConversationProcessConfig.php | 71 + .../MessageAnalysisConfig.php | 307 ++++ .../SuggestionConfig.php | 363 +++++ .../SuggestionFeatureConfig.php | 665 +++++++++ .../SuggestionQueryConfig.php | 409 ++++++ .../ContextFilterSettings.php | 140 ++ .../DialogflowQuerySource.php | 124 ++ .../HumanAgentSideConfig.php | 76 + .../DocumentQuerySource.php | 80 ++ .../KnowledgeBaseQuerySource.php | 80 ++ .../SuggestionQueryConfig/Sections.php | 82 ++ .../Sections/SectionType.php | 100 ++ .../SuggestionTriggerSettings.php | 105 ++ .../V2/HumanAgentAssistantEvent.php | 148 ++ .../Dialogflow/V2/HumanAgentHandoffConfig.php | 111 ++ .../LivePersonConfig.php | 71 + .../SalesforceLiveAgentConfig.php | 181 +++ .../Dialogflow/V2/ImportAgentRequest.php | 165 +++ ...mportConversationDataOperationMetadata.php | 163 +++ ...mportConversationDataOperationResponse.php | 111 ++ .../V2/ImportConversationDataRequest.php | 120 ++ .../Dialogflow/V2/ImportDocumentTemplate.php | 147 ++ .../Dialogflow/V2/ImportDocumentsRequest.php | 212 +++ .../Dialogflow/V2/ImportDocumentsResponse.php | 68 + .../Dialogflow/V2/InferenceParameter.php | 277 ++++ .../V2/IngestContextReferencesRequest.php | 142 ++ .../V2/IngestContextReferencesResponse.php | 67 + .../V2/IngestedContextReferenceDebugInfo.php | 139 ++ .../IngestedParameterDebugInfo.php | 101 ++ .../IngestionStatus.php | 92 ++ .../V2/InitializeEncryptionSpecMetadata.php | 77 + .../V2/InitializeEncryptionSpecRequest.php | 105 ++ .../V2/InitializeEncryptionSpecResponse.php | 33 + .../Cloud/Dialogflow/V2/InputAudioConfig.php | 660 +++++++++ .../Cloud/Dialogflow/V2/InputConfig.php | 82 ++ .../Cloud/Dialogflow/V2/InputDataset.php | 76 + .../Cloud/Dialogflow/V2/InputTextConfig.php | 75 + .../src/Google/Cloud/Dialogflow/V2/Intent.php | 904 ++++++++++++ .../V2/Intent/FollowupIntentInfo.php | 109 ++ .../Cloud/Dialogflow/V2/Intent/Message.php | 542 +++++++ .../V2/Intent/Message/BasicCard.php | 213 +++ .../V2/Intent/Message/BasicCard/Button.php | 111 ++ .../BasicCard/Button/OpenUriAction.php | 67 + .../V2/Intent/Message/BrowseCarouselCard.php | 110 ++ .../BrowseCarouselCardItem.php | 231 +++ .../BrowseCarouselCardItem/OpenUrlAction.php | 105 ++ .../OpenUrlAction/UrlTypeHint.php | 62 + .../ImageDisplayOptions.php | 86 ++ .../Dialogflow/V2/Intent/Message/Card.php | 169 +++ .../V2/Intent/Message/Card/Button.php | 105 ++ .../V2/Intent/Message/CarouselSelect.php | 67 + .../V2/Intent/Message/CarouselSelect/Item.php | 189 +++ .../V2/Intent/Message/ColumnProperties.php | 102 ++ .../ColumnProperties/HorizontalAlignment.php | 68 + .../Dialogflow/V2/Intent/Message/Image.php | 105 ++ .../V2/Intent/Message/LinkOutSuggestion.php | 106 ++ .../V2/Intent/Message/ListSelect.php | 135 ++ .../V2/Intent/Message/ListSelect/Item.php | 189 +++ .../V2/Intent/Message/MediaContent.php | 101 ++ .../MediaContent/ResponseMediaObject.php | 210 +++ .../MediaContent/ResponseMediaType.php | 54 + .../Dialogflow/V2/Intent/Message/Platform.php | 113 ++ .../V2/Intent/Message/QuickReplies.php | 101 ++ .../V2/Intent/Message/SelectItemInfo.php | 110 ++ .../V2/Intent/Message/SimpleResponse.php | 147 ++ .../V2/Intent/Message/SimpleResponses.php | 70 + .../V2/Intent/Message/Suggestion.php | 68 + .../V2/Intent/Message/Suggestions.php | 67 + .../V2/Intent/Message/TableCard.php | 247 ++++ .../V2/Intent/Message/TableCardCell.php | 68 + .../V2/Intent/Message/TableCardRow.php | 101 ++ .../Dialogflow/V2/Intent/Message/Text.php | 67 + .../Cloud/Dialogflow/V2/Intent/Parameter.php | 357 +++++ .../Dialogflow/V2/Intent/TrainingPhrase.php | 237 ++++ .../V2/Intent/TrainingPhrase/Part.php | 193 +++ .../V2/Intent/TrainingPhrase/Type.php | 67 + .../Dialogflow/V2/Intent/WebhookState.php | 62 + .../Cloud/Dialogflow/V2/IntentBatch.php | 67 + .../Cloud/Dialogflow/V2/IntentSuggestion.php | 153 ++ .../Google/Cloud/Dialogflow/V2/IntentView.php | 56 + .../Dialogflow/V2/KnowledgeAssistAnswer.php | 215 +++ .../AdditionalSuggestedQueryResult.php | 119 ++ .../KnowledgeAssistAnswer/KnowledgeAnswer.php | 209 +++ .../KnowledgeAnswer/EventSource.php | 111 ++ .../KnowledgeAnswer/FaqSource.php | 67 + .../KnowledgeAnswer/GenerativeSource.php | 71 + .../GenerativeSource/Snippet.php | 179 +++ .../KnowledgeAssistAnswer/SuggestedQuery.php | 101 ++ .../SuggestedQuery/SearchContext.php | 107 ++ .../V2/KnowledgeAssistDebugInfo.php | 359 +++++ .../KnowledgeAssistBehavior.php | 639 +++++++++ .../QueryCategorizationFailureReason.php | 68 + .../QueryGenerationDebugInfo.php | 135 ++ .../QueryGenerationFailureReason.php | 124 ++ .../Cloud/Dialogflow/V2/KnowledgeBase.php | 166 +++ .../V2/KnowledgeOperationMetadata.php | 187 +++ .../V2/KnowledgeOperationMetadata/State.php | 68 + .../V2/ListAnswerRecordsRequest.php | 254 ++++ .../V2/ListAnswerRecordsResponse.php | 122 ++ .../Dialogflow/V2/ListContextsRequest.php | 179 +++ .../Dialogflow/V2/ListContextsResponse.php | 110 ++ .../V2/ListConversationDatasetsRequest.php | 159 +++ .../V2/ListConversationDatasetsResponse.php | 106 ++ ...istConversationModelEvaluationsRequest.php | 158 +++ ...stConversationModelEvaluationsResponse.php | 106 ++ .../V2/ListConversationModelsRequest.php | 158 +++ .../V2/ListConversationModelsResponse.php | 106 ++ .../V2/ListConversationProfilesRequest.php | 159 +++ .../V2/ListConversationProfilesResponse.php | 110 ++ .../V2/ListConversationsRequest.php | 213 +++ .../V2/ListConversationsResponse.php | 110 ++ .../Dialogflow/V2/ListDocumentsRequest.php | 254 ++++ .../Dialogflow/V2/ListDocumentsResponse.php | 106 ++ .../Dialogflow/V2/ListEntityTypesRequest.php | 230 +++ .../Dialogflow/V2/ListEntityTypesResponse.php | 110 ++ .../Dialogflow/V2/ListEnvironmentsRequest.php | 170 +++ .../V2/ListEnvironmentsResponse.php | 110 ++ .../V2/ListGeneratorEvaluationsRequest.php | 168 +++ .../V2/ListGeneratorEvaluationsResponse.php | 105 ++ .../Dialogflow/V2/ListGeneratorsRequest.php | 158 +++ .../Dialogflow/V2/ListGeneratorsResponse.php | 105 ++ .../Dialogflow/V2/ListIntentsRequest.php | 308 ++++ .../Dialogflow/V2/ListIntentsResponse.php | 110 ++ .../V2/ListKnowledgeBasesRequest.php | 265 ++++ .../V2/ListKnowledgeBasesResponse.php | 106 ++ .../Dialogflow/V2/ListMessagesRequest.php | 222 +++ .../Dialogflow/V2/ListMessagesResponse.php | 114 ++ .../Dialogflow/V2/ListParticipantsRequest.php | 164 +++ .../V2/ListParticipantsResponse.php | 110 ++ .../V2/ListSessionEntityTypesRequest.php | 179 +++ .../V2/ListSessionEntityTypesResponse.php | 110 ++ .../Dialogflow/V2/ListSipTrunksRequest.php | 159 +++ .../Dialogflow/V2/ListSipTrunksResponse.php | 106 ++ .../Cloud/Dialogflow/V2/ListToolsRequest.php | 158 +++ .../Cloud/Dialogflow/V2/ListToolsResponse.php | 105 ++ .../Dialogflow/V2/ListVersionsRequest.php | 170 +++ .../Dialogflow/V2/ListVersionsResponse.php | 110 ++ .../Cloud/Dialogflow/V2/LoggingConfig.php | 79 ++ .../Google/Cloud/Dialogflow/V2/Message.php | 399 ++++++ .../Cloud/Dialogflow/V2/MessageAnnotation.php | 109 ++ .../Cloud/Dialogflow/V2/MessageEntry.php | 187 +++ .../Cloud/Dialogflow/V2/MessageEntry/Role.php | 69 + .../Dialogflow/V2/NotificationConfig.php | 149 ++ .../V2/NotificationConfig/MessageFormat.php | 61 + .../V2/OriginalDetectIntentRequest.php | 202 +++ .../Cloud/Dialogflow/V2/OutputAudio.php | 115 ++ .../Cloud/Dialogflow/V2/OutputAudioConfig.php | 163 +++ .../Dialogflow/V2/OutputAudioEncoding.php | 93 ++ .../Cloud/Dialogflow/V2/Participant.php | 473 ++++++ .../V2/Participant/AgentDesktopSource.php | 84 ++ .../Cloud/Dialogflow/V2/Participant/Role.php | 69 + .../Google/Cloud/Dialogflow/V2/QueryInput.php | 148 ++ .../Cloud/Dialogflow/V2/QueryParameters.php | 461 ++++++ .../Cloud/Dialogflow/V2/QueryResult.php | 847 +++++++++++ .../Cloud/Dialogflow/V2/RaiSettings.php | 67 + .../V2/RaiSettings/RaiCategoryConfig.php | 101 ++ .../RaiCategoryConfig/RaiCategory.php | 75 + .../RaiCategoryConfig/SensitivityLevel.php | 80 ++ .../Dialogflow/V2/ReloadDocumentRequest.php | 225 +++ .../Dialogflow/V2/RestoreAgentRequest.php | 165 +++ .../Dialogflow/V2/SearchAgentsRequest.php | 159 +++ .../Dialogflow/V2/SearchAgentsResponse.php | 110 ++ .../Dialogflow/V2/SearchKnowledgeAnswer.php | 181 +++ .../V2/SearchKnowledgeAnswer/AnswerSource.php | 179 +++ .../V2/SearchKnowledgeAnswer/AnswerType.php | 82 ++ .../V2/SearchKnowledgeDebugInfo.php | 203 +++ .../SearchKnowledgeBehavior.php | 143 ++ .../Dialogflow/V2/SearchKnowledgeRequest.php | 516 +++++++ .../V2/SearchKnowledgeRequest/QuerySource.php | 66 + .../SearchKnowledgeRequest/SearchConfig.php | 129 ++ .../SearchConfig/BoostSpecs.php | 113 ++ .../SearchConfig/BoostSpecs/BoostSpec.php | 82 ++ .../BoostSpec/ConditionBoostSpec.php | 229 +++ .../ConditionBoostSpec/BoostControlSpec.php | 208 +++ .../BoostControlSpec/AttributeType.php | 70 + .../BoostControlSpec/ControlPoint.php | 127 ++ .../BoostControlSpec/InterpolationType.php | 56 + .../SearchConfig/FilterSpecs.php | 121 ++ .../Dialogflow/V2/SearchKnowledgeResponse.php | 150 ++ .../Google/Cloud/Dialogflow/V2/Sentiment.php | 112 ++ .../V2/SentimentAnalysisRequestConfig.php | 75 + .../Dialogflow/V2/SentimentAnalysisResult.php | 89 ++ .../Cloud/Dialogflow/V2/ServiceLatency.php | 67 + .../ServiceLatency/InternalServiceLatency.php | 189 +++ .../Cloud/Dialogflow/V2/SessionEntityType.php | 181 +++ .../SessionEntityType/EntityOverrideMode.php | 70 + .../Cloud/Dialogflow/V2/SetAgentRequest.php | 135 ++ ...ggestionFeatureConfigOperationMetadata.php | 193 +++ .../V2/SetSuggestionFeatureConfigRequest.php | 194 +++ .../Google/Cloud/Dialogflow/V2/SipConfig.php | 305 ++++ .../Google/Cloud/Dialogflow/V2/SipTrunk.php | 182 +++ .../Cloud/Dialogflow/V2/SmartReplyAnswer.php | 155 ++ .../Cloud/Dialogflow/V2/SmartReplyMetrics.php | 143 ++ .../V2/SmartReplyMetrics/TopNMetrics.php | 121 ++ .../Dialogflow/V2/SmartReplyModelMetadata.php | 71 + .../Cloud/Dialogflow/V2/SpeechContext.php | 162 +++ .../Dialogflow/V2/SpeechModelVariant.php | 92 ++ .../Dialogflow/V2/SpeechToTextConfig.php | 486 +++++++ .../Cloud/Dialogflow/V2/SpeechWordInfo.php | 225 +++ .../Cloud/Dialogflow/V2/SsmlVoiceGender.php | 70 + .../V2/StreamingAnalyzeContentRequest.php | 739 ++++++++++ .../V2/StreamingAnalyzeContentResponse.php | 537 +++++++ .../V2/StreamingDetectIntentRequest.php | 523 +++++++ .../V2/StreamingDetectIntentResponse.php | 377 +++++ .../V2/StreamingRecognitionResult.php | 366 +++++ .../MessageType.php | 68 + .../Dialogflow/V2/SuggestArticlesRequest.php | 228 +++ .../Dialogflow/V2/SuggestArticlesResponse.php | 168 +++ .../V2/SuggestConversationSummaryRequest.php | 232 +++ .../V2/SuggestConversationSummaryResponse.php | 178 +++ .../Summary.php | 223 +++ .../Summary/SummarySection.php | 101 ++ .../V2/SuggestFaqAnswersRequest.php | 224 +++ .../V2/SuggestFaqAnswersResponse.php | 168 +++ .../V2/SuggestKnowledgeAssistRequest.php | 214 +++ .../V2/SuggestKnowledgeAssistResponse.php | 212 +++ .../V2/SuggestSmartRepliesRequest.php | 232 +++ .../V2/SuggestSmartRepliesResponse.php | 176 +++ .../V2/SuggestionDedupingConfig.php | 106 ++ .../Cloud/Dialogflow/V2/SuggestionFeature.php | 69 + .../Dialogflow/V2/SuggestionFeature/Type.php | 89 ++ .../Cloud/Dialogflow/V2/SuggestionInput.php | 209 +++ .../Dialogflow/V2/SuggestionInput/Action.php | 72 + .../Cloud/Dialogflow/V2/SuggestionResult.php | 249 ++++ .../Dialogflow/V2/SummarizationContext.php | 185 +++ .../V2/SummarizationEvaluationMetrics.php | 219 +++ .../AccuracyDecomposition.php | 145 ++ .../AdherenceDecomposition.php | 136 ++ .../AdherenceRubric.php | 154 ++ .../CompletenessRubric.php | 119 ++ .../ConversationDetail.php | 186 +++ .../ConversationDetail/MetricDetail.php | 150 ++ .../MetricDetail/SectionDetail.php | 187 +++ .../Decomposition.php | 109 ++ .../EvaluationResult.php | 142 ++ .../OverallScoresByMetric.php | 69 + .../SectionToken.php | 111 ++ .../SummarizationEvaluationResult.php | 287 ++++ .../Dialogflow/V2/SummarizationSection.php | 139 ++ .../V2/SummarizationSection/Type.php | 122 ++ .../V2/SummarizationSectionList.php | 67 + .../Cloud/Dialogflow/V2/SummarySuggestion.php | 67 + .../V2/SummarySuggestion/SummarySection.php | 101 ++ .../Dialogflow/V2/SynthesizeSpeechConfig.php | 303 ++++ .../Cloud/Dialogflow/V2/TelephonyDtmf.php | 160 +++ .../Dialogflow/V2/TelephonyDtmfEvents.php | 67 + .../Google/Cloud/Dialogflow/V2/TextInput.php | 118 ++ .../Dialogflow/V2/TextToSpeechSettings.php | 197 +++ .../src/Google/Cloud/Dialogflow/V2/Tool.php | 569 ++++++++ .../Dialogflow/V2/Tool/Authentication.php | 180 +++ .../V2/Tool/Authentication/ApiKeyConfig.php | 189 +++ .../Tool/Authentication/BearerTokenConfig.php | 133 ++ .../V2/Tool/Authentication/OAuthConfig.php | 261 ++++ .../OAuthConfig/OauthGrantType.php | 57 + .../Tool/Authentication/RequestLocation.php | 61 + .../Authentication/ServiceAgentAuthConfig.php | 80 ++ .../ServiceAgentAuth.php | 70 + .../V2/Tool/ConfirmationRequirement.php | 62 + .../Dialogflow/V2/Tool/ConnectorTool.php | 105 ++ .../V2/Tool/ConnectorTool/Action.php | 184 +++ .../ConnectorTool/Action/EntityOperation.php | 101 ++ .../Action/EntityOperation/OperationType.php | 87 ++ .../Dialogflow/V2/Tool/ExtensionTool.php | 75 + .../Cloud/Dialogflow/V2/Tool/FunctionTool.php | 183 +++ .../Cloud/Dialogflow/V2/Tool/MethodType.php | 82 ++ .../Cloud/Dialogflow/V2/Tool/OpenApiTool.php | 208 +++ .../V2/Tool/ServiceDirectoryConfig.php | 87 ++ .../Cloud/Dialogflow/V2/Tool/TLSConfig.php | 71 + .../Dialogflow/V2/Tool/TLSConfig/CACert.php | 149 ++ .../Google/Cloud/Dialogflow/V2/ToolCall.php | 456 ++++++ .../Cloud/Dialogflow/V2/ToolCall/State.php | 61 + .../Cloud/Dialogflow/V2/ToolCallResult.php | 421 ++++++ .../Dialogflow/V2/ToolCallResult/Error.php | 67 + .../Cloud/Dialogflow/V2/ToolsetTool.php | 147 ++ .../Cloud/Dialogflow/V2/TrainAgentRequest.php | 87 ++ .../Cloud/Dialogflow/V2/TriggerEvent.php | 77 + ...ployConversationModelOperationMetadata.php | 165 +++ .../V2/UndeployConversationModelRequest.php | 72 + .../V2/UpdateAnswerRecordRequest.php | 137 ++ .../Dialogflow/V2/UpdateContextRequest.php | 137 ++ .../V2/UpdateConversationProfileRequest.php | 137 ++ .../Dialogflow/V2/UpdateDocumentRequest.php | 147 ++ .../Dialogflow/V2/UpdateEntityTypeRequest.php | 204 +++ .../V2/UpdateEnvironmentRequest.php | 168 +++ .../V2/UpdateFulfillmentRequest.php | 142 ++ .../Dialogflow/V2/UpdateGeneratorRequest.php | 141 ++ .../Dialogflow/V2/UpdateIntentRequest.php | 246 ++++ .../V2/UpdateKnowledgeBaseRequest.php | 147 ++ .../V2/UpdateParticipantRequest.php | 137 ++ .../V2/UpdateSessionEntityTypeRequest.php | 150 ++ .../Dialogflow/V2/UpdateSipTrunkRequest.php | 142 ++ .../Cloud/Dialogflow/V2/UpdateToolRequest.php | 146 ++ .../Dialogflow/V2/UpdateVersionRequest.php | 158 +++ .../Cloud/Dialogflow/V2/ValidationError.php | 183 +++ .../V2/ValidationError/Severity.php | 75 + .../Cloud/Dialogflow/V2/ValidationResult.php | 67 + .../Google/Cloud/Dialogflow/V2/Version.php | 254 ++++ .../Dialogflow/V2/Version/VersionStatus.php | 68 + .../Dialogflow/V2/VoiceSelectionParams.php | 129 ++ .../Cloud/Dialogflow/V2/WebhookRequest.php | 217 +++ .../Cloud/Dialogflow/V2/WebhookResponse.php | 430 ++++++ .../samples/V2/AgentsClient/delete_agent.php | 70 + .../samples/V2/AgentsClient/export_agent.php | 105 ++ .../v2/samples/V2/AgentsClient/get_agent.php | 72 + .../samples/V2/AgentsClient/get_location.php | 57 + .../V2/AgentsClient/get_validation_result.php | 73 + .../samples/V2/AgentsClient/import_agent.php | 107 ++ .../V2/AgentsClient/list_locations.php | 77 + .../samples/V2/AgentsClient/restore_agent.php | 105 ++ .../samples/V2/AgentsClient/search_agents.php | 83 ++ .../v2/samples/V2/AgentsClient/set_agent.php | 102 ++ .../samples/V2/AgentsClient/train_agent.php | 94 ++ .../V2/AnswerRecordsClient/get_location.php | 57 + .../list_answer_records.php | 79 ++ .../V2/AnswerRecordsClient/list_locations.php | 77 + .../update_answer_record.php | 65 + .../V2/ContextsClient/create_context.php | 99 ++ .../V2/ContextsClient/delete_all_contexts.php | 74 + .../V2/ContextsClient/delete_context.php | 74 + .../samples/V2/ContextsClient/get_context.php | 76 + .../V2/ContextsClient/get_location.php | 57 + .../V2/ContextsClient/list_contexts.php | 81 ++ .../V2/ContextsClient/list_locations.php | 77 + .../V2/ContextsClient/update_context.php | 88 ++ .../create_conversation_dataset.php | 99 ++ .../delete_conversation_dataset.php | 95 ++ .../get_conversation_dataset.php | 77 + .../get_location.php | 57 + .../import_conversation_data.php | 103 ++ .../list_conversation_datasets.php | 78 + .../list_locations.php | 77 + .../create_conversation_model.php | 112 ++ .../create_conversation_model_evaluation.php | 91 ++ .../delete_conversation_model.php | 89 ++ .../deploy_conversation_model.php | 92 ++ .../get_conversation_model.php | 71 + .../get_conversation_model_evaluation.php | 72 + .../ConversationModelsClient/get_location.php | 57 + .../list_conversation_model_evaluations.php | 76 + .../list_conversation_models.php | 76 + .../list_locations.php | 77 + .../undeploy_conversation_model.php | 92 ++ .../clear_suggestion_feature_config.php | 110 ++ .../create_conversation_profile.php | 86 ++ .../delete_conversation_profile.php | 74 + .../get_conversation_profile.php | 76 + .../get_location.php | 57 + .../list_conversation_profiles.php | 77 + .../list_locations.php | 77 + .../set_suggestion_feature_config.php | 111 ++ .../update_conversation_profile.php | 82 ++ .../complete_conversation.php | 74 + .../create_conversation.php | 106 ++ .../generate_stateless_suggestion.php | 73 + .../generate_stateless_summary.php | 99 ++ .../generate_suggestions.php | 78 + .../ConversationsClient/get_conversation.php | 73 + .../V2/ConversationsClient/get_location.php | 57 + .../ingest_context_references.php | 76 + .../list_conversations.php | 77 + .../V2/ConversationsClient/list_locations.php | 77 + .../V2/ConversationsClient/list_messages.php | 82 ++ .../ConversationsClient/search_knowledge.php | 92 ++ .../suggest_conversation_summary.php | 75 + .../V2/DocumentsClient/create_document.php | 116 ++ .../V2/DocumentsClient/delete_document.php | 91 ++ .../V2/DocumentsClient/export_document.php | 94 ++ .../V2/DocumentsClient/get_document.php | 73 + .../V2/DocumentsClient/get_location.php | 57 + .../V2/DocumentsClient/import_documents.php | 114 ++ .../V2/DocumentsClient/list_documents.php | 78 + .../V2/DocumentsClient/list_locations.php | 77 + .../V2/DocumentsClient/reload_document.php | 99 ++ .../V2/DocumentsClient/update_document.php | 104 ++ .../get_encryption_spec.php | 71 + .../get_location.php | 57 + .../initialize_encryption_spec.php | 93 ++ .../list_locations.php | 77 + .../batch_create_entities.php | 125 ++ .../batch_delete_entities.php | 100 ++ .../batch_delete_entity_types.php | 101 ++ .../batch_update_entities.php | 128 ++ .../batch_update_entity_types.php | 97 ++ .../EntityTypesClient/create_entity_type.php | 88 ++ .../EntityTypesClient/delete_entity_type.php | 74 + .../V2/EntityTypesClient/get_entity_type.php | 72 + .../V2/EntityTypesClient/get_location.php | 57 + .../EntityTypesClient/list_entity_types.php | 77 + .../V2/EntityTypesClient/list_locations.php | 77 + .../EntityTypesClient/update_entity_type.php | 80 ++ .../EnvironmentsClient/create_environment.php | 80 ++ .../EnvironmentsClient/delete_environment.php | 76 + .../V2/EnvironmentsClient/get_environment.php | 78 + .../get_environment_history.php | 83 ++ .../V2/EnvironmentsClient/get_location.php | 57 + .../EnvironmentsClient/list_environments.php | 80 ++ .../V2/EnvironmentsClient/list_locations.php | 77 + .../EnvironmentsClient/update_environment.php | 73 + .../V2/FulfillmentsClient/get_fulfillment.php | 72 + .../V2/FulfillmentsClient/get_location.php | 57 + .../V2/FulfillmentsClient/list_locations.php | 77 + .../FulfillmentsClient/update_fulfillment.php | 81 ++ .../create_generator_evaluation.php | 118 ++ .../delete_generator_evaluation.php | 76 + .../get_generator_evaluation.php | 78 + .../get_location.php | 57 + .../list_generator_evaluations.php | 83 ++ .../list_locations.php | 77 + .../V2/GeneratorsClient/create_generator.php | 74 + .../V2/GeneratorsClient/delete_generator.php | 70 + .../V2/GeneratorsClient/get_generator.php | 72 + .../V2/GeneratorsClient/get_location.php | 57 + .../V2/GeneratorsClient/list_generators.php | 77 + .../V2/GeneratorsClient/list_locations.php | 77 + .../V2/GeneratorsClient/update_generator.php | 59 + .../V2/IntentsClient/batch_delete_intents.php | 101 ++ .../V2/IntentsClient/batch_update_intents.php | 97 ++ .../V2/IntentsClient/create_intent.php | 81 ++ .../V2/IntentsClient/delete_intent.php | 75 + .../samples/V2/IntentsClient/get_intent.php | 72 + .../samples/V2/IntentsClient/get_location.php | 57 + .../samples/V2/IntentsClient/list_intents.php | 85 ++ .../V2/IntentsClient/list_locations.php | 77 + .../V2/IntentsClient/update_intent.php | 76 + .../create_knowledge_base.php | 80 ++ .../delete_knowledge_base.php | 71 + .../get_knowledge_base.php | 73 + .../V2/KnowledgeBasesClient/get_location.php | 57 + .../list_knowledge_bases.php | 77 + .../KnowledgeBasesClient/list_locations.php | 77 + .../update_knowledge_base.php | 73 + .../V2/ParticipantsClient/analyze_content.php | 82 ++ .../ParticipantsClient/create_participant.php | 75 + .../V2/ParticipantsClient/get_location.php | 57 + .../V2/ParticipantsClient/get_participant.php | 77 + .../V2/ParticipantsClient/list_locations.php | 77 + .../ParticipantsClient/list_participants.php | 78 + .../streaming_analyze_content.php | 97 ++ .../ParticipantsClient/suggest_articles.php | 78 + .../suggest_faq_answers.php | 78 + .../suggest_knowledge_assist.php | 77 + .../suggest_smart_replies.php | 78 + .../ParticipantsClient/update_participant.php | 62 + .../create_session_entity_type.php | 141 ++ .../delete_session_entity_type.php | 83 ++ .../SessionEntityTypesClient/get_location.php | 57 + .../get_session_entity_type.php | 85 ++ .../list_locations.php | 77 + .../list_session_entity_types.php | 85 ++ .../update_session_entity_type.php | 127 ++ .../V2/SessionsClient/detect_intent.php | 104 ++ .../V2/SessionsClient/get_location.php | 57 + .../V2/SessionsClient/list_locations.php | 77 + .../streaming_detect_intent.php | 109 ++ .../V2/SipTrunksClient/create_sip_trunk.php | 81 ++ .../V2/SipTrunksClient/delete_sip_trunk.php | 71 + .../V2/SipTrunksClient/get_location.php | 57 + .../V2/SipTrunksClient/get_sip_trunk.php | 73 + .../V2/SipTrunksClient/list_locations.php | 77 + .../V2/SipTrunksClient/list_sip_trunks.php | 77 + .../V2/SipTrunksClient/update_sip_trunk.php | 74 + .../v2/samples/V2/ToolsClient/create_tool.php | 79 ++ .../v2/samples/V2/ToolsClient/delete_tool.php | 70 + .../samples/V2/ToolsClient/get_location.php | 57 + .../v2/samples/V2/ToolsClient/get_tool.php | 72 + .../samples/V2/ToolsClient/list_locations.php | 77 + .../v2/samples/V2/ToolsClient/list_tools.php | 77 + .../v2/samples/V2/ToolsClient/update_tool.php | 74 + .../V2/VersionsClient/create_version.php | 79 ++ .../V2/VersionsClient/delete_version.php | 74 + .../V2/VersionsClient/get_location.php | 57 + .../samples/V2/VersionsClient/get_version.php | 76 + .../V2/VersionsClient/list_locations.php | 77 + .../V2/VersionsClient/list_versions.php | 80 ++ .../V2/VersionsClient/update_version.php | 66 + .../v2/src/V2/Client/AgentsClient.php | 755 ++++++++++ .../v2/src/V2/Client/AnswerRecordsClient.php | 811 +++++++++++ .../v2/src/V2/Client/ContextsClient.php | 661 +++++++++ .../V2/Client/ConversationDatasetsClient.php | 555 ++++++++ .../V2/Client/ConversationModelsClient.php | 845 +++++++++++ .../V2/Client/ConversationProfilesClient.php | 956 +++++++++++++ .../v2/src/V2/Client/ConversationsClient.php | 1252 ++++++++++++++++ .../v2/src/V2/Client/DocumentsClient.php | 739 ++++++++++ .../V2/Client/EncryptionSpecServiceClient.php | 416 ++++++ .../v2/src/V2/Client/EntityTypesClient.php | 802 +++++++++++ .../v2/src/V2/Client/EnvironmentsClient.php | 670 +++++++++ .../v2/src/V2/Client/FulfillmentsClient.php | 387 +++++ .../V2/Client/GeneratorEvaluationsClient.php | 553 ++++++++ .../v2/src/V2/Client/GeneratorsClient.php | 521 +++++++ .../v2/src/V2/Client/IntentsClient.php | 889 ++++++++++++ .../v2/src/V2/Client/KnowledgeBasesClient.php | 510 +++++++ .../v2/src/V2/Client/ParticipantsClient.php | 1108 +++++++++++++++ .../V2/Client/SessionEntityTypesClient.php | 662 +++++++++ .../v2/src/V2/Client/SessionsClient.php | 707 +++++++++ .../v2/src/V2/Client/SipTrunksClient.php | 457 ++++++ .../v2/src/V2/Client/ToolsClient.php | 501 +++++++ .../v2/src/V2/Client/VersionsClient.php | 531 +++++++ .../Dialogflow/v2/src/V2/gapic_metadata.json | 1077 ++++++++++++++ .../V2/resources/agents_client_config.json | 89 ++ .../V2/resources/agents_descriptor_config.php | 214 +++ .../resources/agents_rest_client_config.php | 270 ++++ .../answer_records_client_config.json | 54 + .../answer_records_descriptor_config.php | 121 ++ .../answer_records_rest_client_config.php | 149 ++ .../V2/resources/contexts_client_config.json | 74 + .../resources/contexts_descriptor_config.php | 155 ++ .../resources/contexts_rest_client_config.php | 265 ++++ .../conversation_datasets_client_config.json | 69 + ...onversation_datasets_descriptor_config.php | 155 ++ ...nversation_datasets_rest_client_config.php | 182 +++ .../conversation_models_client_config.json | 89 ++ .../conversation_models_descriptor_config.php | 233 +++ ...conversation_models_rest_client_config.php | 260 ++++ .../conversation_profiles_client_config.json | 79 ++ ...onversation_profiles_descriptor_config.php | 191 +++ ...nversation_profiles_rest_client_config.php | 240 ++++ .../conversations_client_config.json | 99 ++ .../conversations_descriptor_config.php | 251 ++++ .../conversations_rest_client_config.php | 311 ++++ .../V2/resources/documents_client_config.json | 84 ++ .../resources/documents_descriptor_config.php | 217 +++ .../documents_rest_client_config.php | 280 ++++ ...encryption_spec_service_client_config.json | 54 + ...ryption_spec_service_descriptor_config.php | 97 ++ ...yption_spec_service_rest_client_config.php | 130 ++ .../resources/entity_types_client_config.json | 94 ++ .../entity_types_descriptor_config.php | 234 +++ .../entity_types_rest_client_config.php | 291 ++++ .../resources/environments_client_config.json | 74 + .../environments_descriptor_config.php | 165 +++ .../environments_rest_client_config.php | 225 +++ .../resources/fulfillments_client_config.json | 54 + .../fulfillments_descriptor_config.php | 92 ++ .../fulfillments_rest_client_config.php | 149 ++ .../generator_evaluations_client_config.json | 64 + ...enerator_evaluations_descriptor_config.php | 132 ++ ...nerator_evaluations_rest_client_config.php | 151 ++ .../resources/generators_client_config.json | 69 + .../generators_descriptor_config.php | 138 ++ .../generators_rest_client_config.php | 177 +++ .../V2/resources/intents_client_config.json | 79 ++ .../resources/intents_descriptor_config.php | 187 +++ .../resources/intents_rest_client_config.php | 242 ++++ .../knowledge_bases_client_config.json | 69 + .../knowledge_bases_descriptor_config.php | 138 ++ .../knowledge_bases_rest_client_config.php | 218 +++ .../resources/participants_client_config.json | 124 ++ .../participants_descriptor_config.php | 213 +++ .../participants_rest_client_config.php | 280 ++++ .../session_entity_types_client_config.json | 69 + ...session_entity_types_descriptor_config.php | 143 ++ ...ession_entity_types_rest_client_config.php | 240 ++++ .../V2/resources/sessions_client_config.json | 74 + .../resources/sessions_descriptor_config.php | 99 ++ .../resources/sessions_rest_client_config.php | 135 ++ .../resources/sip_trunks_client_config.json | 69 + .../sip_trunks_descriptor_config.php | 135 ++ .../sip_trunks_rest_client_config.php | 164 +++ .../src/V2/resources/tools_client_config.json | 69 + .../V2/resources/tools_descriptor_config.php | 137 ++ .../V2/resources/tools_rest_client_config.php | 164 +++ .../V2/resources/versions_client_config.json | 69 + .../resources/versions_descriptor_config.php | 139 ++ .../resources/versions_rest_client_config.php | 202 +++ .../tests/Unit/V2/Client/AgentsClientTest.php | 1091 ++++++++++++++ .../V2/Client/AnswerRecordsClientTest.php | 377 +++++ .../Unit/V2/Client/ContextsClientTest.php | 640 +++++++++ .../Client/ConversationDatasetsClientTest.php | 825 +++++++++++ .../Client/ConversationModelsClientTest.php | 1203 ++++++++++++++++ .../Client/ConversationProfilesClientTest.php | 943 ++++++++++++ .../V2/Client/ConversationsClientTest.php | 1033 ++++++++++++++ .../Unit/V2/Client/DocumentsClientTest.php | 1243 ++++++++++++++++ .../EncryptionSpecServiceClientTest.php | 418 ++++++ .../Unit/V2/Client/EntityTypesClientTest.php | 1263 +++++++++++++++++ .../Unit/V2/Client/EnvironmentsClientTest.php | 670 +++++++++ .../Unit/V2/Client/FulfillmentsClientTest.php | 371 +++++ .../Client/GeneratorEvaluationsClientTest.php | 647 +++++++++ .../Unit/V2/Client/GeneratorsClientTest.php | 576 ++++++++ .../Unit/V2/Client/IntentsClientTest.php | 918 ++++++++++++ .../V2/Client/KnowledgeBasesClientTest.php | 586 ++++++++ .../Unit/V2/Client/ParticipantsClientTest.php | 959 +++++++++++++ .../Client/SessionEntityTypesClientTest.php | 591 ++++++++ .../Unit/V2/Client/SessionsClientTest.php | 413 ++++++ .../Unit/V2/Client/SipTrunksClientTest.php | 578 ++++++++ .../tests/Unit/V2/Client/ToolsClientTest.php | 610 ++++++++ .../Unit/V2/Client/VersionsClientTest.php | 583 ++++++++ 830 files changed, 140934 insertions(+) create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AnswerRecord.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AudioConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesApp.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesTool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationModel.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationProfile.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Gcs.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Operations.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Session.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SessionEntityType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SipTrunk.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Tool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ToolCall.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Toolset.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ValidationResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Version.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Webhook.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult/DuplicateSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/TriggerEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/AgentActionSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult/DuplicateSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/SampleResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/Sources.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnnotatedMessagePart.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleSuggestionModelMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AssistQueryParameters.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchCreateEntitiesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntitiesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntityTypesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteIntentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntitiesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesAppSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesToolSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/CertificateState.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/ErrorDetails.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent/ContentFormat.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/UpdateMode.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext/GeneratorType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/MimeContent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/SipHeader.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSipTrunkRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateToolRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams/PhoneticEncoding.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DatastoreResponseReason.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAllContextsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSipTrunkRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteToolRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationStatus.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/AgentAssistInputDataConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/DatasetInputDataConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig/SummaryGenerationOption.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataSourceType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/SummarizationConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion/ToolCallInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSipTrunkRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetToolRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo/IngestionStatus.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/AdditionalSuggestedQueryResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/EventSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery/SearchContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/KnowledgeAssistBehavior.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryCategorizationFailureReason.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationDebugInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationFailureReason.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/AgentDesktopSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/RaiCategory.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/SensitivityLevel.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RestoreAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo/SearchKnowledgeBehavior.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/QuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency/InternalServiceLatency.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipTrunk.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyModelMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SsmlVoiceGender.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary/SummarySection.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionDedupingConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput/Action.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AccuracyDecomposition.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceDecomposition.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceRubric.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/CompletenessRubric.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail/SectionDetail.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/Decomposition.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/EvaluationResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/OverallScoresByMetric.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SectionToken.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SummarizationEvaluationResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ApiKeyConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/BearerTokenConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig/OauthGrantType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/RequestLocation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig/ServiceAgentAuth.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConfirmationRequirement.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation/OperationType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ExtensionTool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/FunctionTool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/MethodType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/OpenApiTool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ServiceDirectoryConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig/CACert.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult/Error.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolsetTool.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSipTrunkRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateToolRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_suggestions.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/ingest_context_references.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/create_generator_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/delete_generator_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_generator_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_generator_evaluations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/create_sip_trunk.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/delete_sip_trunk.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_sip_trunk.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_sip_trunks.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/update_sip_trunk.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/create_tool.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/delete_tool.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_tool.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_tools.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/update_tool.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/AgentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorEvaluationsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SipTrunksClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ToolsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AgentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AnswerRecordsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ContextsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorEvaluationsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SipTrunksClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ToolsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Agent.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Agent.php new file mode 100644 index 000000000000..2bdb6e65a708 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Agent.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + "\x0A\xBF%\x0A&google/cloud/dialogflow/v2/agent.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A2google/cloud/dialogflow/v2/validation_result.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\"\xA5\x07\x0A\x05Agent\x12C\x0A\x06parent\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x0A+cloudresourcemanager.googleapis.com/Project\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\"\x0A\x15default_language_code\x18\x03 \x01(\x09B\x03\xE0A\x02\x12%\x0A\x18supported_language_codes\x18\x04 \x03(\x09B\x03\xE0A\x01\x12\x16\x0A\x09time_zone\x18\x05 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bdescription\x18\x06 \x01(\x09B\x03\xE0A\x01\x12\x17\x0A\x0Aavatar_uri\x18\x07 \x01(\x09B\x03\xE0A\x01\x12\x1B\x0A\x0Eenable_logging\x18\x08 \x01(\x08B\x03\xE0A\x01\x12F\x0A\x0Amatch_mode\x18\x09 \x01(\x0E2+.google.cloud.dialogflow.v2.Agent.MatchModeB\x05\x18\x01\xE0A\x01\x12%\x0A\x18classification_threshold\x18\x0A \x01(\x02B\x03\xE0A\x01\x12F\x0A\x0Bapi_version\x18\x0E \x01(\x0E2,.google.cloud.dialogflow.v2.Agent.ApiVersionB\x03\xE0A\x01\x129\x0A\x04tier\x18\x0F \x01(\x0E2&.google.cloud.dialogflow.v2.Agent.TierB\x03\xE0A\x01\"V\x0A\x09MatchMode\x12\x1A\x0A\x16MATCH_MODE_UNSPECIFIED\x10\x00\x12\x15\x0A\x11MATCH_MODE_HYBRID\x10\x01\x12\x16\x0A\x12MATCH_MODE_ML_ONLY\x10\x02\"l\x0A\x0AApiVersion\x12\x1B\x0A\x17API_VERSION_UNSPECIFIED\x10\x00\x12\x12\x0A\x0EAPI_VERSION_V1\x10\x01\x12\x12\x0A\x0EAPI_VERSION_V2\x10\x02\x12\x19\x0A\x15API_VERSION_V2_BETA_1\x10\x03\"b\x0A\x04Tier\x12\x14\x0A\x10TIER_UNSPECIFIED\x10\x00\x12\x11\x0A\x0DTIER_STANDARD\x10\x01\x12\x13\x0A\x0FTIER_ENTERPRISE\x10\x02\x12\x1C\x0A\x14TIER_ENTERPRISE_PLUS\x10\x03\x1A\x02\x08\x01:m\xEAAj\x0A\x1Fdialogflow.googleapis.com/Agent\x12\x18projects/{project}/agent\x12-projects/{project}/locations/{location}/agent\"J\x0A\x0FGetAgentRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\"~\x0A\x0FSetAgentRequest\x125\x0A\x05agent\x18\x01 \x01(\x0B2!.google.cloud.dialogflow.v2.AgentB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"M\x0A\x12DeleteAgentRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\"z\x0A\x13SearchAgentsRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\"b\x0A\x14SearchAgentsResponse\x121\x0A\x06agents\x18\x01 \x03(\x0B2!.google.cloud.dialogflow.v2.Agent\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"L\x0A\x11TrainAgentRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\"e\x0A\x12ExportAgentRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\x12\x16\x0A\x09agent_uri\x18\x02 \x01(\x09B\x03\xE0A\x02\"L\x0A\x13ExportAgentResponse\x12\x13\x0A\x09agent_uri\x18\x01 \x01(\x09H\x00\x12\x17\x0A\x0Dagent_content\x18\x02 \x01(\x0CH\x00B\x07\x0A\x05agent\"\x84\x01\x0A\x12ImportAgentRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\x12\x13\x0A\x09agent_uri\x18\x02 \x01(\x09H\x00\x12\x17\x0A\x0Dagent_content\x18\x03 \x01(\x0CH\x00B\x07\x0A\x05agent\"\x85\x01\x0A\x13RestoreAgentRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\x12\x13\x0A\x09agent_uri\x18\x02 \x01(\x09H\x00\x12\x17\x0A\x0Dagent_content\x18\x03 \x01(\x0CH\x00B\x07\x0A\x05agent\"q\x0A\x1AGetValidationResultRequest\x127\x0A\x06parent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x12\x1Fdialogflow.googleapis.com/Agent\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x012\xAA\x11\x0A\x06Agents\x12\xB7\x01\x0A\x08GetAgent\x12+.google.cloud.dialogflow.v2.GetAgentRequest\x1A!.google.cloud.dialogflow.v2.Agent\"[\xDAA\x06parent\x82\xD3\xE4\x93\x02L\x12\x1D/v2/{parent=projects/*}/agentZ+\x12)/v2/{parent=projects/*/locations/*}/agent\x12\xD0\x01\x0A\x08SetAgent\x12+.google.cloud.dialogflow.v2.SetAgentRequest\x1A!.google.cloud.dialogflow.v2.Agent\"t\xDAA\x05agent\x82\xD3\xE4\x93\x02f\"#/v2/{agent.parent=projects/*}/agent:\x05agentZ8\"//v2/{agent.parent=projects/*/locations/*}/agent:\x05agent\x12\xB2\x01\x0A\x0BDeleteAgent\x12..google.cloud.dialogflow.v2.DeleteAgentRequest\x1A\x16.google.protobuf.Empty\"[\xDAA\x06parent\x82\xD3\xE4\x93\x02L*\x1D/v2/{parent=projects/*}/agentZ+*)/v2/{parent=projects/*/locations/*}/agent\x12\xDC\x01\x0A\x0CSearchAgents\x12/.google.cloud.dialogflow.v2.SearchAgentsRequest\x1A0.google.cloud.dialogflow.v2.SearchAgentsResponse\"i\xDAA\x06parent\x82\xD3\xE4\x93\x02Z\x12\$/v2/{parent=projects/*}/agent:searchZ2\x120/v2/{parent=projects/*/locations/*}/agent:search\x12\xFC\x01\x0A\x0ATrainAgent\x12-.google.cloud.dialogflow.v2.TrainAgentRequest\x1A\x1D.google.longrunning.Operation\"\x9F\x01\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xDAA\x06parent\x82\xD3\xE4\x93\x02^\"#/v2/{parent=projects/*}/agent:train:\x01*Z4\"//v2/{parent=projects/*/locations/*}/agent:train:\x01*\x12\x99\x02\x0A\x0BExportAgent\x12..google.cloud.dialogflow.v2.ExportAgentRequest\x1A\x1D.google.longrunning.Operation\"\xBA\x01\xCAAH\x0A.google.cloud.dialogflow.v2.ExportAgentResponse\x12\x16google.protobuf.Struct\xDAA\x06parent\x82\xD3\xE4\x93\x02`\"\$/v2/{parent=projects/*}/agent:export:\x01*Z5\"0/v2/{parent=projects/*/locations/*}/agent:export:\x01*\x12\xF7\x01\x0A\x0BImportAgent\x12..google.cloud.dialogflow.v2.ImportAgentRequest\x1A\x1D.google.longrunning.Operation\"\x98\x01\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xD3\xE4\x93\x02`\"\$/v2/{parent=projects/*}/agent:import:\x01*Z5\"0/v2/{parent=projects/*/locations/*}/agent:import:\x01*\x12\xFB\x01\x0A\x0CRestoreAgent\x12/.google.cloud.dialogflow.v2.RestoreAgentRequest\x1A\x1D.google.longrunning.Operation\"\x9A\x01\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xD3\xE4\x93\x02b\"%/v2/{parent=projects/*}/agent:restore:\x01*Z6\"1/v2/{parent=projects/*/locations/*}/agent:restore:\x01*\x12\xF1\x01\x0A\x13GetValidationResult\x126.google.cloud.dialogflow.v2.GetValidationResultRequest\x1A,.google.cloud.dialogflow.v2.ValidationResult\"t\x82\xD3\xE4\x93\x02n\x12./v2/{parent=projects/*}/agent/validationResultZ<\x12:/v2/{parent=projects/*/locations/*}/agent/validationResult\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x90\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0AAgentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php new file mode 100644 index 000000000000..b6a6f3f255bf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\xA6\x08\x0A;google/cloud/dialogflow/v2/agent_coaching_instruction.proto\x12\x1Agoogle.cloud.dialogflow.v2\"\x9C\x06\x0A\x18AgentCoachingInstruction\x12\x19\x0A\x0Cdisplay_name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x1C\x0A\x0Fdisplay_details\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09condition\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cagent_action\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x1A\x0A\x0Dsystem_action\x18\x05 \x01(\x09B\x03\xE0A\x01\x12n\x0A\x16duplicate_check_result\x18\x08 \x01(\x0B2I.google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResultB\x03\xE0A\x03\x12`\x0A\x10triggering_event\x18\x0A \x01(\x0E2A.google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEventB\x03\xE0A\x01\x1A\x8B\x02\x0A\x14DuplicateCheckResult\x12\x81\x01\x0A\x15duplicate_suggestions\x18\x01 \x03(\x0B2].google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestionB\x03\xE0A\x03\x1Ao\x0A\x13DuplicateSuggestion\x12\x1A\x0A\x0Danswer_record\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x1D\x0A\x10suggestion_index\x18\x03 \x01(\x05B\x03\xE0A\x03\x12\x1D\x0A\x10similarity_score\x18\x04 \x01(\x02B\x03\xE0A\x03\"\x97\x01\x0A\x0CTriggerEvent\x12\x1D\x0A\x19TRIGGER_EVENT_UNSPECIFIED\x10\x00\x12\x14\x0A\x10END_OF_UTTERANCE\x10\x01\x12\x0F\x0A\x0BMANUAL_CALL\x10\x02\x12\x14\x0A\x10CUSTOMER_MESSAGE\x10\x03\x12\x11\x0A\x0DAGENT_MESSAGE\x10\x04\x12\x18\x0A\x14TOOL_CALL_COMPLETION\x10\x05B\xA3\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x1DAgentCoachingInstructionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AnswerRecord.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AnswerRecord.php new file mode 100644 index 000000000000..b379434b803b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AnswerRecord.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + "\x0A\xFA \x0A.google/cloud/dialogflow/v2/answer_record.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A*google/cloud/dialogflow/v2/generator.proto\x1A,google/cloud/dialogflow/v2/participant.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xF1\x02\x0A\x0CAnswerRecord\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12H\x0A\x0Fanswer_feedback\x18\x02 \x01(\x0B2*.google.cloud.dialogflow.v2.AnswerFeedbackB\x03\xE0A\x02\x12W\x0A\x16agent_assistant_record\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.AgentAssistantRecordB\x03\xE0A\x03H\x00:\xA5\x01\xEAA\xA1\x01\x0A&dialogflow.googleapis.com/AnswerRecord\x120projects/{project}/answerRecords/{answer_record}\x12Eprojects/{project}/locations/{location}/answerRecords/{answer_record}B\x08\x0A\x06record\"\xA0\x01\x0A\x18ListAnswerRecordsRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&dialogflow.googleapis.com/AnswerRecord\x12\x13\x0A\x06filter\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09page_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x04 \x01(\x09B\x03\xE0A\x01\"v\x0A\x19ListAnswerRecordsResponse\x12@\x0A\x0Eanswer_records\x18\x01 \x03(\x0B2(.google.cloud.dialogflow.v2.AnswerRecord\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\x97\x01\x0A\x19UpdateAnswerRecordRequest\x12D\x0A\x0Danswer_record\x18\x01 \x01(\x0B2(.google.cloud.dialogflow.v2.AnswerRecordB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\"\xD2\x03\x0A\x0EAnswerFeedback\x12V\x0A\x11correctness_level\x18\x01 \x01(\x0E2;.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel\x12]\x0A\x1Fagent_assistant_detail_feedback\x18\x02 \x01(\x0B22.google.cloud.dialogflow.v2.AgentAssistantFeedbackH\x00\x12\x0F\x0A\x07clicked\x18\x03 \x01(\x08\x12.\x0A\x0Aclick_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12\x11\x0A\x09displayed\x18\x04 \x01(\x08\x120\x0A\x0Cdisplay_time\x18\x06 \x01(\x0B2\x1A.google.protobuf.Timestamp\"p\x0A\x10CorrectnessLevel\x12!\x0A\x1DCORRECTNESS_LEVEL_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BNOT_CORRECT\x10\x01\x12\x15\x0A\x11PARTIALLY_CORRECT\x10\x02\x12\x11\x0A\x0DFULLY_CORRECT\x10\x03B\x11\x0A\x0Fdetail_feedback\"\xFB\x0A\x0A\x16AgentAssistantFeedback\x12a\x0A\x10answer_relevance\x18\x01 \x01(\x0E2B.google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevanceB\x03\xE0A\x01\x12i\x0A\x14document_correctness\x18\x02 \x01(\x0E2F.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectnessB\x03\xE0A\x01\x12g\x0A\x13document_efficiency\x18\x03 \x01(\x0E2E.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiencyB\x03\xE0A\x01\x12m\x0A\x16summarization_feedback\x18\x04 \x01(\x0B2H.google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedbackB\x03\xE0A\x01\x12r\x0A\x19knowledge_search_feedback\x18\x05 \x01(\x0B2J.google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedbackB\x03\xE0A\x01\x12r\x0A\x19knowledge_assist_feedback\x18\x06 \x01(\x0B2J.google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedbackB\x03\xE0A\x01\x1A\xBB\x02\x0A\x15SummarizationFeedback\x12.\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12/\x0A\x0Bsubmit_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12\x14\x0A\x0Csummary_text\x18\x03 \x01(\x09\x12v\x0A\x0Dtext_sections\x18\x04 \x03(\x0B2Z.google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback.TextSectionsEntryB\x03\xE0A\x01\x1A3\x0A\x11TextSectionsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\x1AF\x0A\x17KnowledgeSearchFeedback\x12\x15\x0A\x0Danswer_copied\x18\x01 \x01(\x08\x12\x14\x0A\x0Cclicked_uris\x18\x02 \x03(\x09\x1AF\x0A\x17KnowledgeAssistFeedback\x12\x15\x0A\x0Danswer_copied\x18\x01 \x01(\x08\x12\x14\x0A\x0Cclicked_uris\x18\x02 \x03(\x09\"Q\x0A\x0FAnswerRelevance\x12 \x0A\x1CANSWER_RELEVANCE_UNSPECIFIED\x10\x00\x12\x0E\x0A\x0AIRRELEVANT\x10\x01\x12\x0C\x0A\x08RELEVANT\x10\x02\"W\x0A\x13DocumentCorrectness\x12\$\x0A DOCUMENT_CORRECTNESS_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09INCORRECT\x10\x01\x12\x0B\x0A\x07CORRECT\x10\x02\"Y\x0A\x12DocumentEfficiency\x12#\x0A\x1FDOCUMENT_EFFICIENCY_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BINEFFICIENT\x10\x01\x12\x0D\x0A\x09EFFICIENT\x10\x02\"\xEA\x02\x0A\x14AgentAssistantRecord\x12S\x0A\x19article_suggestion_answer\x18\x05 \x01(\x0B2).google.cloud.dialogflow.v2.ArticleAnswerB\x03\xE0A\x03H\x00\x12@\x0A\x0Afaq_answer\x18\x06 \x01(\x0B2%.google.cloud.dialogflow.v2.FaqAnswerB\x03\xE0A\x03H\x00\x12[\x0A\x18dialogflow_assist_answer\x18\x07 \x01(\x0B22.google.cloud.dialogflow.v2.DialogflowAssistAnswerB\x03\xE0A\x03H\x00\x12T\x0A\x14generator_suggestion\x18\x08 \x01(\x0B2/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xE0A\x03H\x00B\x08\x0A\x06answer2\xAD\x05\x0A\x0DAnswerRecords\x12\xED\x01\x0A\x11ListAnswerRecords\x124.google.cloud.dialogflow.v2.ListAnswerRecordsRequest\x1A5.google.cloud.dialogflow.v2.ListAnswerRecordsResponse\"k\xDAA\x06parent\x82\xD3\xE4\x93\x02\\\x12%/v2/{parent=projects/*}/answerRecordsZ3\x121/v2/{parent=projects/*/locations/*}/answerRecords\x12\xB1\x02\x0A\x12UpdateAnswerRecord\x125.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest\x1A(.google.cloud.dialogflow.v2.AnswerRecord\"\xB9\x01\xDAA\x19answer_record,update_mask\x82\xD3\xE4\x93\x02\x96\x0123/v2/{answer_record.name=projects/*/answerRecords/*}:\x0Danswer_recordZP2?/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}:\x0Danswer_record\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x98\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x12AnswerRecordsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AudioConfig.php new file mode 100644 index 000000000000..78723dbddf4e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AudioConfig.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + "\x0A\xF5\x1C\x0A-google/cloud/dialogflow/v2/audio_config.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\x1A\x1Egoogle/protobuf/duration.proto\"9\x0A\x0DSpeechContext\x12\x14\x0A\x07phrases\x18\x01 \x03(\x09B\x03\xE0A\x01\x12\x12\x0A\x05boost\x18\x02 \x01(\x02B\x03\xE0A\x01\"\x92\x01\x0A\x0ESpeechWordInfo\x12\x0C\x0A\x04word\x18\x03 \x01(\x09\x12/\x0A\x0Cstart_offset\x18\x01 \x01(\x0B2\x19.google.protobuf.Duration\x12-\x0A\x0Aend_offset\x18\x02 \x01(\x0B2\x19.google.protobuf.Duration\x12\x12\x0A\x0Aconfidence\x18\x04 \x01(\x02\"\xB6\x04\x0A\x10InputAudioConfig\x12F\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2).google.cloud.dialogflow.v2.AudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05B\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x10enable_word_info\x18\x0D \x01(\x08\x12\x18\x0A\x0Cphrase_hints\x18\x04 \x03(\x09B\x02\x18\x01\x12B\x0A\x0Fspeech_contexts\x18\x0B \x03(\x0B2).google.cloud.dialogflow.v2.SpeechContext\x12\x0D\x0A\x05model\x18\x07 \x01(\x09\x12E\x0A\x0Dmodel_variant\x18\x0A \x01(\x0E2..google.cloud.dialogflow.v2.SpeechModelVariant\x12\x18\x0A\x10single_utterance\x18\x08 \x01(\x08\x12*\x0A\"disable_no_speech_recognized_event\x18\x0E \x01(\x08\x12\$\x0A\x1Cenable_automatic_punctuation\x18\x11 \x01(\x08\x129\x0A\x0Bphrase_sets\x18\x14 \x03(\x09B\$\xFAA!\x0A\x1Fspeech.googleapis.com/PhraseSet\x12)\x0A!opt_out_conformer_model_migration\x18\x1A \x01(\x08\"p\x0A\x14VoiceSelectionParams\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12E\x0A\x0Bssml_gender\x18\x02 \x01(\x0E2+.google.cloud.dialogflow.v2.SsmlVoiceGenderB\x03\xE0A\x01\"\xA0\x02\x0A\x16SynthesizeSpeechConfig\x12\x1A\x0A\x0Dspeaking_rate\x18\x01 \x01(\x01B\x03\xE0A\x01\x12\x12\x0A\x05pitch\x18\x02 \x01(\x01B\x03\xE0A\x01\x12\x1B\x0A\x0Evolume_gain_db\x18\x03 \x01(\x01B\x03\xE0A\x01\x12\x1F\x0A\x12effects_profile_id\x18\x05 \x03(\x09B\x03\xE0A\x01\x12D\x0A\x05voice\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.VoiceSelectionParamsB\x03\xE0A\x01\x12R\x0A\x0Epronunciations\x18\x06 \x03(\x0B25.google.cloud.dialogflow.v2.CustomPronunciationParamsB\x03\xE0A\x01\"\x96\x02\x0A\x19CustomPronunciationParams\x12\x0E\x0A\x06phrase\x18\x01 \x01(\x09\x12a\x0A\x11phonetic_encoding\x18\x02 \x01(\x0E2F.google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\x12\x15\x0A\x0Dpronunciation\x18\x03 \x01(\x09\"o\x0A\x10PhoneticEncoding\x12!\x0A\x1DPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\x0A\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1D\x0A\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\"\xD2\x01\x0A\x11OutputAudioConfig\x12L\x0A\x0Eaudio_encoding\x18\x01 \x01(\x0E2/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xE0A\x02\x12\x19\x0A\x11sample_rate_hertz\x18\x02 \x01(\x05\x12T\x0A\x18synthesize_speech_config\x18\x03 \x01(\x0B22.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\x0A\x13TelephonyDtmfEvents\x12>\x0A\x0Bdtmf_events\x18\x01 \x03(\x0E2).google.cloud.dialogflow.v2.TelephonyDtmf\"\xE2\x02\x0A\x12SpeechToTextConfig\x12L\x0A\x14speech_model_variant\x18\x01 \x01(\x0E2..google.cloud.dialogflow.v2.SpeechModelVariant\x12\x0D\x0A\x05model\x18\x02 \x01(\x09\x129\x0A\x0Bphrase_sets\x18\x04 \x03(\x09B\$\xFAA!\x0A\x1Fspeech.googleapis.com/PhraseSet\x12A\x0A\x0Eaudio_encoding\x18\x06 \x01(\x0E2).google.cloud.dialogflow.v2.AudioEncoding\x12\x19\x0A\x11sample_rate_hertz\x18\x07 \x01(\x05\x12\x15\x0A\x0Dlanguage_code\x18\x08 \x01(\x09\x12\x18\x0A\x10enable_word_info\x18\x09 \x01(\x08\x12%\x0A\x1Duse_timeout_based_endpointing\x18\x0B \x01(\x08*\x94\x02\x0A\x0DTelephonyDtmf\x12\x1E\x0A\x1ATELEPHONY_DTMF_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08DTMF_ONE\x10\x01\x12\x0C\x0A\x08DTMF_TWO\x10\x02\x12\x0E\x0A\x0ADTMF_THREE\x10\x03\x12\x0D\x0A\x09DTMF_FOUR\x10\x04\x12\x0D\x0A\x09DTMF_FIVE\x10\x05\x12\x0C\x0A\x08DTMF_SIX\x10\x06\x12\x0E\x0A\x0ADTMF_SEVEN\x10\x07\x12\x0E\x0A\x0ADTMF_EIGHT\x10\x08\x12\x0D\x0A\x09DTMF_NINE\x10\x09\x12\x0D\x0A\x09DTMF_ZERO\x10\x0A\x12\x0A\x0A\x06DTMF_A\x10\x0B\x12\x0A\x0A\x06DTMF_B\x10\x0C\x12\x0A\x0A\x06DTMF_C\x10\x0D\x12\x0A\x0A\x06DTMF_D\x10\x0E\x12\x0D\x0A\x09DTMF_STAR\x10\x0F\x12\x0E\x0A\x0ADTMF_POUND\x10\x10*\x94\x02\x0A\x0DAudioEncoding\x12\x1E\x0A\x1AAUDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x1C\x0A\x18AUDIO_ENCODING_LINEAR_16\x10\x01\x12\x17\x0A\x13AUDIO_ENCODING_FLAC\x10\x02\x12\x18\x0A\x14AUDIO_ENCODING_MULAW\x10\x03\x12\x16\x0A\x12AUDIO_ENCODING_AMR\x10\x04\x12\x19\x0A\x15AUDIO_ENCODING_AMR_WB\x10\x05\x12\x1B\x0A\x17AUDIO_ENCODING_OGG_OPUS\x10\x06\x12)\x0A%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x17\x0A\x13AUDIO_ENCODING_ALAW\x10\x08*v\x0A\x12SpeechModelVariant\x12\$\x0A SPEECH_MODEL_VARIANT_UNSPECIFIED\x10\x00\x12\x16\x0A\x12USE_BEST_AVAILABLE\x10\x01\x12\x10\x0A\x0CUSE_STANDARD\x10\x02\x12\x10\x0A\x0CUSE_ENHANCED\x10\x03*\x8D\x01\x0A\x0FSsmlVoiceGender\x12!\x0A\x1DSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x1A\x0A\x16SSML_VOICE_GENDER_MALE\x10\x01\x12\x1C\x0A\x18SSML_VOICE_GENDER_FEMALE\x10\x02\x12\x1D\x0A\x19SSML_VOICE_GENDER_NEUTRAL\x10\x03*\x90\x02\x0A\x13OutputAudioEncoding\x12%\x0A!OUTPUT_AUDIO_ENCODING_UNSPECIFIED\x10\x00\x12#\x0A\x1FOUTPUT_AUDIO_ENCODING_LINEAR_16\x10\x01\x12!\x0A\x19OUTPUT_AUDIO_ENCODING_MP3\x10\x02\x1A\x02\x08\x01\x12%\x0A!OUTPUT_AUDIO_ENCODING_MP3_64_KBPS\x10\x04\x12\"\x0A\x1EOUTPUT_AUDIO_ENCODING_OGG_OPUS\x10\x03\x12\x1F\x0A\x1BOUTPUT_AUDIO_ENCODING_MULAW\x10\x05\x12\x1E\x0A\x1AOUTPUT_AUDIO_ENCODING_ALAW\x10\x06B\xD3\x02\x0A\x1Ecom.google.cloud.dialogflow.v2B\x10AudioConfigProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAAU\x0A\x1Bautoml.googleapis.com/Model\x126projects/{project}/locations/{location}/models/{model}\xEAAb\x0A\x1Fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesApp.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesApp.php new file mode 100644 index 000000000000..d8a68dcfb6e8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesApp.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + "\x0A\x88\x05\x0A(google/cloud/dialogflow/v2/ces_app.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\x1A%google/cloud/dialogflow/v2/tool.proto\"\x92\x02\x0A\x0ACesAppSpec\x12/\x0A\x07ces_app\x18\x01 \x01(\x09B\x1E\xE0A\x01\xFAA\x18\x0A\x16ces.googleapis.com/App\x12_\x0A\x18confirmation_requirement\x18\x02 \x01(\x0E28.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xE0A\x01\x12#\x0A\x11proactive_enabled\x18\x03 \x01(\x08B\x03\xE0A\x01H\x00\x88\x01\x01\x12\"\x0A\x10reactive_enabled\x18\x04 \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01B\x14\x0A\x12_proactive_enabledB\x13\x0A\x11_reactive_enabledB\xE0\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0BCesAppProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAAL\x0A\x16ces.googleapis.com/App\x122projects/{project}/locations/{location}/apps/{app}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesTool.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesTool.php new file mode 100644 index 000000000000..e558f7e4c2b6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/CesTool.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + "\x0A\xCA\x03\x0A)google/cloud/dialogflow/v2/ces_tool.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\x1A%google/cloud/dialogflow/v2/tool.proto\"\xA1\x01\x0A\x0BCesToolSpec\x121\x0A\x08ces_tool\x18\x01 \x01(\x09B\x1F\xE0A\x01\xFAA\x19\x0A\x17ces.googleapis.com/Tool\x12_\x0A\x18confirmation_requirement\x18\x02 \x01(\x0E28.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xE0A\x01B\x92\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0CCesToolProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php new file mode 100644 index 000000000000..76712a256255 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + "\x0A\x8D\"\x0A(google/cloud/dialogflow/v2/context.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\"\x8F\x04\x0A\x07Context\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x1B\x0A\x0Elifespan_count\x18\x02 \x01(\x05B\x03\xE0A\x01\x120\x0A\x0Aparameters\x18\x03 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01:\xA1\x03\xEAA\x9D\x03\x0A!dialogflow.googleapis.com/Context\x12>projects/{project}/agent/sessions/{session}/contexts/{context}\x12fprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}\x12Sprojects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}\x12{projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}\"\x81\x01\x0A\x13ListContextsRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!dialogflow.googleapis.com/Context\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"f\x0A\x14ListContextsResponse\x125\x0A\x08contexts\x18\x01 \x03(\x0B2#.google.cloud.dialogflow.v2.Context\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"L\x0A\x11GetContextRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!dialogflow.googleapis.com/Context\"\x8C\x01\x0A\x14CreateContextRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!dialogflow.googleapis.com/Context\x129\x0A\x07context\x18\x02 \x01(\x0B2#.google.cloud.dialogflow.v2.ContextB\x03\xE0A\x02\"\x87\x01\x0A\x14UpdateContextRequest\x129\x0A\x07context\x18\x01 \x01(\x0B2#.google.cloud.dialogflow.v2.ContextB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"O\x0A\x14DeleteContextRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!dialogflow.googleapis.com/Context\"U\x0A\x18DeleteAllContextsRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!dialogflow.googleapis.com/Context2\xE8\x14\x0A\x08Contexts\x12\x9C\x03\x0A\x0CListContexts\x12/.google.cloud.dialogflow.v2.ListContextsRequest\x1A0.google.cloud.dialogflow.v2.ListContextsResponse\"\xA8\x02\xDAA\x06parent\x82\xD3\xE4\x93\x02\x98\x02\x121/v2/{parent=projects/*/agent/sessions/*}/contextsZJ\x12H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?\x12=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV\x12T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts\x12\x89\x03\x0A\x0AGetContext\x12-.google.cloud.dialogflow.v2.GetContextRequest\x1A#.google.cloud.dialogflow.v2.Context\"\xA6\x02\xDAA\x04name\x82\xD3\xE4\x93\x02\x98\x02\x121/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ\x12H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?\x12=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV\x12T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}\x12\xBD\x03\x0A\x0DCreateContext\x120.google.cloud.dialogflow.v2.CreateContextRequest\x1A#.google.cloud.dialogflow.v2.Context\"\xD4\x02\xDAA\x0Eparent,context\x82\xD3\xE4\x93\x02\xBC\x02\"1/v2/{parent=projects/*/agent/sessions/*}/contexts:\x07contextZS\"H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts:\x07contextZH\"=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts:\x07contextZ_\"T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts:\x07context\x12\xE2\x03\x0A\x0DUpdateContext\x120.google.cloud.dialogflow.v2.UpdateContextRequest\x1A#.google.cloud.dialogflow.v2.Context\"\xF9\x02\xDAA\x13context,update_mask\x82\xD3\xE4\x93\x02\xDC\x0229/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:\x07contextZ[2P/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}:\x07contextZP2E/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}:\x07contextZg2\\/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}:\x07context\x12\x82\x03\x0A\x0DDeleteContext\x120.google.cloud.dialogflow.v2.DeleteContextRequest\x1A\x16.google.protobuf.Empty\"\xA6\x02\xDAA\x04name\x82\xD3\xE4\x93\x02\x98\x02*1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ*H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?*=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV*T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}\x12\x8C\x03\x0A\x11DeleteAllContexts\x124.google.cloud.dialogflow.v2.DeleteAllContextsRequest\x1A\x16.google.protobuf.Empty\"\xA8\x02\xDAA\x06parent\x82\xD3\xE4\x93\x02\x98\x02*1/v2/{parent=projects/*/agent/sessions/*}/contextsZJ*H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?*=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV*T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x92\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0CContextProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Conversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Conversation.php new file mode 100644 index 000000000000..6c57d75cc3e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Conversation.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + "\x0A\x97w\x0A-google/cloud/dialogflow/v2/conversation.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A5google/cloud/dialogflow/v2/conversation_profile.proto\x1A*google/cloud/dialogflow/v2/generator.proto\x1A,google/cloud/dialogflow/v2/participant.proto\x1A(google/cloud/dialogflow/v2/session.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xF4\x16\x0A\x0CConversation\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x03\xE0A\x08\x12U\x0A\x0Flifecycle_state\x18\x02 \x01(\x0E27.google.cloud.dialogflow.v2.Conversation.LifecycleStateB\x03\xE0A\x03\x12S\x0A\x14conversation_profile\x18\x03 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationProfile\x12N\x0A\x0Cphone_number\x18\x04 \x01(\x0B23.google.cloud.dialogflow.v2.ConversationPhoneNumberB\x03\xE0A\x03\x123\x0A\x0Astart_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x121\x0A\x08end_time\x18\x06 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12[\x0A\x12conversation_stage\x18\x07 \x01(\x0E2:.google.cloud.dialogflow.v2.Conversation.ConversationStageB\x03\xE0A\x01\x12h\x0A\x19telephony_connection_info\x18\x0A \x01(\x0B2@.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfoB\x03\xE0A\x03\x12]\x0A\x1Cinitial_conversation_profile\x18\x0F \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationProfileB\x06\xE0A\x01\xE0A\x03\x12q\x0A\x1Bingested_context_references\x18\x11 \x03(\x0B2G.google.cloud.dialogflow.v2.Conversation.IngestedContextReferencesEntryB\x03\xE0A\x03\x12o\x0A\x1Ainitial_generator_contexts\x18\x12 \x03(\x0B2F.google.cloud.dialogflow.v2.Conversation.InitialGeneratorContextsEntryB\x03\xE0A\x03\x1A\x8E\x03\x0A\x17TelephonyConnectionInfo\x12\x1A\x0A\x0Ddialed_number\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x10\x0A\x03sdp\x18\x05 \x01(\x09B\x03\xE0A\x01\x12d\x0A\x0Bsip_headers\x18\x0C \x03(\x0B2J.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeaderB\x03\xE0A\x03\x12n\x0A\x13extra_mime_contents\x18\x0D \x03(\x0B2L.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContentB\x03\xE0A\x03\x1A2\x0A\x09SipHeader\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x12\x0A\x05value\x18\x02 \x01(\x09B\x03\xE0A\x01\x1A;\x0A\x0BMimeContent\x12\x16\x0A\x09mime_type\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x14\x0A\x07content\x18\x02 \x01(\x0CB\x03\xE0A\x01\x1A\xAC\x05\x0A\x10ContextReference\x12g\x0A\x10context_contents\x18\x01 \x03(\x0B2H.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContentB\x03\xE0A\x02\x12^\x0A\x0Bupdate_mode\x18\x02 \x01(\x0E2D.google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateModeB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x1A\xB6\x02\x0A\x0EContextContent\x12\x14\x0A\x07content\x18\x01 \x01(\x09B\x03\xE0A\x02\x12s\x0A\x0Econtent_format\x18\x02 \x01(\x0E2V.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormatB\x03\xE0A\x02\x127\x0A\x0Eingestion_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x15\x0A\x0Danswer_record\x18\x04 \x01(\x09\"I\x0A\x0DContentFormat\x12\x1E\x0A\x1ACONTENT_FORMAT_UNSPECIFIED\x10\x00\x12\x08\x0A\x04JSON\x10\x01\x12\x0E\x0A\x0APLAIN_TEXT\x10\x02\"D\x0A\x0AUpdateMode\x12\x1B\x0A\x17UPDATE_MODE_UNSPECIFIED\x10\x00\x12\x0A\x0A\x06APPEND\x10\x01\x12\x0D\x0A\x09OVERWRITE\x10\x02\x1A\xA6\x02\x0A\x10GeneratorContext\x12d\x0A\x0Egenerator_type\x18\x01 \x01(\x0E2G.google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorTypeB\x03\xE0A\x03\"\xAB\x01\x0A\x0DGeneratorType\x12\x1E\x0A\x1AGENERATOR_TYPE_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09FREE_FORM\x10\x01\x12\x12\x0A\x0EAGENT_COACHING\x10\x02\x12\x11\x0A\x0DSUMMARIZATION\x10\x03\x12\x0F\x0A\x0BTRANSLATION\x10\x04\x12\x12\x0A\x0EAGENT_FEEDBACK\x10\x05\x12\x1F\x0A\x1BCUSTOMER_MESSAGE_GENERATION\x10\x06\x1A{\x0A\x1EIngestedContextReferencesEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12H\x0A\x05value\x18\x02 \x01(\x0B29.google.cloud.dialogflow.v2.Conversation.ContextReference:\x028\x01\x1Az\x0A\x1DInitialGeneratorContextsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12H\x0A\x05value\x18\x02 \x01(\x0B29.google.cloud.dialogflow.v2.Conversation.GeneratorContext:\x028\x01\"Q\x0A\x0ELifecycleState\x12\x1F\x0A\x1BLIFECYCLE_STATE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BIN_PROGRESS\x10\x01\x12\x0D\x0A\x09COMPLETED\x10\x02\"h\x0A\x11ConversationStage\x12\"\x0A\x1ECONVERSATION_STAGE_UNSPECIFIED\x10\x00\x12\x17\x0A\x13VIRTUAL_AGENT_STAGE\x10\x01\x12\x16\x0A\x12HUMAN_ASSIST_STAGE\x10\x02:\xC0\x01\xEAA\xBC\x01\x0A&dialogflow.googleapis.com/Conversation\x12/projects/{project}/conversations/{conversation}\x12Dprojects/{project}/locations/{location}/conversations/{conversation}*\x0Dconversations2\x0Cconversation\"\xBE\x01\x0A\x19CreateConversationRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&dialogflow.googleapis.com/Conversation\x12C\x0A\x0Cconversation\x18\x02 \x01(\x0B2(.google.cloud.dialogflow.v2.ConversationB\x03\xE0A\x02\x12\x1C\x0A\x0Fconversation_id\x18\x03 \x01(\x09B\x03\xE0A\x01\"\xA0\x01\x0A\x18ListConversationsRequest\x12>\x0A\x06parent\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x12&dialogflow.googleapis.com/Conversation\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\"u\x0A\x19ListConversationsResponse\x12?\x0A\x0Dconversations\x18\x01 \x03(\x0B2(.google.cloud.dialogflow.v2.Conversation\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"V\x0A\x16GetConversationRequest\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&dialogflow.googleapis.com/Conversation\"[\x0A\x1BCompleteConversationRequest\x12<\x0A\x04name\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&dialogflow.googleapis.com/Conversation\"\x96\x01\x0A\x13ListMessagesRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!dialogflow.googleapis.com/Message\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"f\x0A\x14ListMessagesResponse\x125\x0A\x08messages\x18\x01 \x03(\x0B2#.google.cloud.dialogflow.v2.Message\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"O\x0A\x17ConversationPhoneNumber\x12\x19\x0A\x0Ccountry_code\x18\x02 \x01(\x05B\x03\xE0A\x03\x12\x19\x0A\x0Cphone_number\x18\x03 \x01(\x09B\x03\xE0A\x03\"\xCF\x02\x0A\x1EIngestContextReferencesRequest\x12D\x0A\x0Cconversation\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&dialogflow.googleapis.com/Conversation\x12r\x0A\x12context_references\x18\x02 \x03(\x0B2Q.google.cloud.dialogflow.v2.IngestContextReferencesRequest.ContextReferencesEntryB\x03\xE0A\x02\x1As\x0A\x16ContextReferencesEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12H\x0A\x05value\x18\x02 \x01(\x0B29.google.cloud.dialogflow.v2.Conversation.ContextReference:\x028\x01\"\x9F\x02\x0A\x1FIngestContextReferencesResponse\x12\x7F\x0A\x1Bingested_context_references\x18\x01 \x03(\x0B2Z.google.cloud.dialogflow.v2.IngestContextReferencesResponse.IngestedContextReferencesEntry\x1A{\x0A\x1EIngestedContextReferencesEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12H\x0A\x05value\x18\x02 \x01(\x0B29.google.cloud.dialogflow.v2.Conversation.ContextReference:\x028\x01\"\x9C\x02\x0A!SuggestConversationSummaryRequest\x12D\x0A\x0Cconversation\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&dialogflow.googleapis.com/Conversation\x12A\x0A\x0Elatest_message\x18\x03 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x19\x0A\x0Ccontext_size\x18\x04 \x01(\x05B\x03\xE0A\x01\x12S\x0A\x13assist_query_params\x18\x05 \x01(\x0B21.google.cloud.dialogflow.v2.AssistQueryParametersB\x03\xE0A\x01\"\xAA\x05\x0A\"SuggestConversationSummaryResponse\x12W\x0A\x07summary\x18\x01 \x01(\x0B2F.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary\x12>\x0A\x0Elatest_message\x18\x02 \x01(\x09B&\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\x1A\xD4\x03\x0A\x07Summary\x12\x0C\x0A\x04text\x18\x01 \x01(\x09\x12o\x0A\x0Dtext_sections\x18\x04 \x03(\x0B2X.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.TextSectionsEntry\x12s\x0A\x14sorted_text_sections\x18\x06 \x03(\x0B2U.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection\x12B\x0A\x0Danswer_record\x18\x03 \x01(\x09B+\xFAA(\x0A&dialogflow.googleapis.com/AnswerRecord\x12\x1E\x0A\x16baseline_model_version\x18\x05 \x01(\x09\x1A<\x0A\x0ESummarySection\x12\x14\x0A\x07section\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07summary\x18\x02 \x01(\x09B\x03\xE0A\x03\x1A3\x0A\x11TextSectionsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\xDC\x03\x0A\x1FGenerateStatelessSummaryRequest\x12t\x0A\x16stateless_conversation\x18\x01 \x01(\x0B2O.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversationB\x03\xE0A\x02\x12R\x0A\x14conversation_profile\x18\x02 \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xE0A\x02\x12A\x0A\x0Elatest_message\x18\x03 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x1D\x0A\x10max_context_size\x18\x04 \x01(\x05B\x03\xE0A\x01\x1A\x8C\x01\x0A\x13MinimalConversation\x12:\x0A\x08messages\x18\x01 \x03(\x0B2#.google.cloud.dialogflow.v2.MessageB\x03\xE0A\x02\x129\x0A\x06parent\x18\x02 \x01(\x09B)\xE0A\x02\xFAA#\x0A!locations.googleapis.com/Location\"\xAD\x03\x0A GenerateStatelessSummaryResponse\x12U\x0A\x07summary\x18\x01 \x01(\x0B2D.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary\x12>\x0A\x0Elatest_message\x18\x02 \x01(\x09B&\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\x1A\xDB\x01\x0A\x07Summary\x12\x0C\x0A\x04text\x18\x01 \x01(\x09\x12m\x0A\x0Dtext_sections\x18\x02 \x03(\x0B2V.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary.TextSectionsEntry\x12\x1E\x0A\x16baseline_model_version\x18\x04 \x01(\x09\x1A3\x0A\x11TextSectionsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\xF3\x04\x0A\"GenerateStatelessSuggestionRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!locations.googleapis.com/Location\x12:\x0A\x09generator\x18\x02 \x01(\x0B2%.google.cloud.dialogflow.v2.GeneratorH\x00\x12\x18\x0A\x0Egenerator_name\x18\x03 \x01(\x09H\x00\x12v\x0A\x12context_references\x18\x04 \x03(\x0B2U.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.ContextReferencesEntryB\x03\xE0A\x01\x12R\x0A\x14conversation_context\x18\x05 \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationContextB\x03\xE0A\x01\x12E\x0A\x0Etrigger_events\x18\x06 \x03(\x0E2(.google.cloud.dialogflow.v2.TriggerEventB\x03\xE0A\x01\x12\x1E\x0A\x11security_settings\x18\x08 \x01(\x09B\x03\xE0A\x01\x1As\x0A\x16ContextReferencesEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12H\x0A\x05value\x18\x02 \x01(\x0B29.google.cloud.dialogflow.v2.Conversation.ContextReference:\x028\x01B\x14\x0A\x12generator_resource\"y\x0A#GenerateStatelessSuggestionResponse\x12R\x0A\x14generator_suggestion\x18\x01 \x01(\x0B2/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xE0A\x02\"\x9C\x12\x0A\x16SearchKnowledgeRequest\x12\x13\x0A\x06parent\x18\x06 \x01(\x09B\x03\xE0A\x02\x129\x0A\x05query\x18\x01 \x01(\x0B2%.google.cloud.dialogflow.v2.TextInputB\x03\xE0A\x02\x12S\x0A\x14conversation_profile\x18\x02 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationProfile\x12\x17\x0A\x0Asession_id\x18\x03 \x01(\x09B\x03\xE0A\x02\x12D\x0A\x0Cconversation\x18\x04 \x01(\x09B.\xE0A\x01\xFAA(\x0A&dialogflow.googleapis.com/Conversation\x12A\x0A\x0Elatest_message\x18\x05 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12Y\x0A\x0Cquery_source\x18\x07 \x01(\x0E2>.google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySourceB\x03\xE0A\x01\x127\x0A\x11end_user_metadata\x18\x09 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x12[\x0A\x0Dsearch_config\x18\x0B \x01(\x0B2?.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfigB\x03\xE0A\x01\x12\x19\x0A\x0Cexact_search\x18\x0E \x01(\x08B\x03\xE0A\x01\x1A\xDB\x0C\x0A\x0CSearchConfig\x12d\x0A\x0Bboost_specs\x18\x01 \x03(\x0B2J.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecsB\x03\xE0A\x01\x12f\x0A\x0Cfilter_specs\x18\x02 \x03(\x0B2K.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecsB\x03\xE0A\x01\x1A\xBE\x0A\x0A\x0ABoostSpecs\x12E\x0A\x0Bdata_stores\x18\x01 \x03(\x09B0\xE0A\x01\xFAA*\x0A(discoveryengine.googleapis.com/DataStore\x12g\x0A\x04spec\x18\x02 \x03(\x0B2T.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpecB\x03\xE0A\x01\x1A\xFF\x08\x0A\x09BoostSpec\x12\x8B\x01\x0A\x15condition_boost_specs\x18\x01 \x03(\x0B2g.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpecB\x03\xE0A\x01\x1A\xE3\x07\x0A\x12ConditionBoostSpec\x12\x16\x0A\x09condition\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x12\x0A\x05boost\x18\x02 \x01(\x02B\x03\xE0A\x01\x12\x99\x01\x0A\x12boost_control_spec\x18\x04 \x01(\x0B2x.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xE0A\x01\x1A\x84\x06\x0A\x10BoostControlSpec\x12\x17\x0A\x0Afield_name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\xA4\x01\x0A\x0Eattribute_type\x18\x02 \x01(\x0E2\x86\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xE0A\x01\x12\xAC\x01\x0A\x12interpolation_type\x18\x03 \x01(\x0E2\x8A\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xE0A\x01\x12\xA3\x01\x0A\x0Econtrol_points\x18\x04 \x03(\x0B2\x85\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPointB\x03\xE0A\x01\x1AG\x0A\x0CControlPoint\x12\x1C\x0A\x0Fattribute_value\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cboost_amount\x18\x02 \x01(\x02B\x03\xE0A\x01\"M\x0A\x0DAttributeType\x12\x1E\x0A\x1AATTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09NUMERICAL\x10\x01\x12\x0D\x0A\x09FRESHNESS\x10\x02\"C\x0A\x11InterpolationType\x12\"\x0A\x1EINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\x0A\x0A\x06LINEAR\x10\x01\x1A<\x0A\x0BFilterSpecs\x12\x18\x0A\x0Bdata_stores\x18\x01 \x03(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x02 \x01(\x09B\x03\xE0A\x01\"Q\x0A\x0BQuerySource\x12\x1C\x0A\x18QUERY_SOURCE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BAGENT_QUERY\x10\x01\x12\x13\x0A\x0FSUGGESTED_QUERY\x10\x02\"\xA4\x04\x0A\x18SearchKnowledgeDebugInfo\x12V\x0A\x19datastore_response_reason\x18\x01 \x01(\x0E23.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\x0A\x19search_knowledge_behavior\x18\x02 \x01(\x0B2L.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior\x12l\x0A%ingested_context_reference_debug_info\x18\x03 \x01(\x0B2=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12C\x0A\x0Fservice_latency\x18\x04 \x01(\x0B2*.google.cloud.dialogflow.v2.ServiceLatency\x1A\x8B\x01\x0A\x17SearchKnowledgeBehavior\x12%\x0A\x1Danswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\x0A\x1Aend_user_metadata_included\x18\x02 \x01(\x08\x12%\x0A\x1Dthird_party_connector_allowed\x18\x04 \x01(\x08\"\xD1\x01\x0A\x17SearchKnowledgeResponse\x12B\x0A\x07answers\x18\x02 \x03(\x0B21.google.cloud.dialogflow.v2.SearchKnowledgeAnswer\x12\x17\x0A\x0Frewritten_query\x18\x03 \x01(\x09\x12Y\x0A\x1Bsearch_knowledge_debug_info\x18\x04 \x01(\x0B24.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo\"\xE7\x03\x0A\x15SearchKnowledgeAnswer\x12\x0E\x0A\x06answer\x18\x01 \x01(\x09\x12Q\x0A\x0Banswer_type\x18\x02 \x01(\x0E2<.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType\x12V\x0A\x0Eanswer_sources\x18\x03 \x03(\x0B2>.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource\x12B\x0A\x0Danswer_record\x18\x05 \x01(\x09B+\xFAA(\x0A&dialogflow.googleapis.com/AnswerRecord\x1Af\x0A\x0CAnswerSource\x12\x0D\x0A\x05title\x18\x01 \x01(\x09\x12\x0B\x0A\x03uri\x18\x02 \x01(\x09\x12\x0F\x0A\x07snippet\x18\x03 \x01(\x09\x12)\x0A\x08metadata\x18\x05 \x01(\x0B2\x17.google.protobuf.Struct\"g\x0A\x0AAnswerType\x12\x1B\x0A\x17ANSWER_TYPE_UNSPECIFIED\x10\x00\x12\x07\x0A\x03FAQ\x10\x01\x12\x0E\x0A\x0AGENERATIVE\x10\x02\x12\x0A\x0A\x06INTENT\x10\x03\x12\x0C\x0A\x08PLAYBOOK\x10\x04\x12\x09\x0A\x05EVENT\x10\x05\"\xEC\x01\x0A\x1AGenerateSuggestionsRequest\x12D\x0A\x0Cconversation\x18\x01 \x01(\x09B.\xE0A\x02\xFAA(\x0A&dialogflow.googleapis.com/Conversation\x12A\x0A\x0Elatest_message\x18\x02 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12E\x0A\x0Etrigger_events\x18\x03 \x03(\x0E2(.google.cloud.dialogflow.v2.TriggerEventB\x03\xE0A\x012\xA6\x1A\x0A\x0DConversations\x12\x8C\x02\x0A\x12CreateConversation\x125.google.cloud.dialogflow.v2.CreateConversationRequest\x1A(.google.cloud.dialogflow.v2.Conversation\"\x94\x01\xDAA\x13parent,conversation\x82\xD3\xE4\x93\x02x\"%/v2/{parent=projects/*}/conversations:\x0CconversationZA\"1/v2/{parent=projects/*/locations/*}/conversations:\x0Cconversation\x12\xED\x01\x0A\x11ListConversations\x124.google.cloud.dialogflow.v2.ListConversationsRequest\x1A5.google.cloud.dialogflow.v2.ListConversationsResponse\"k\xDAA\x06parent\x82\xD3\xE4\x93\x02\\\x12%/v2/{parent=projects/*}/conversationsZ3\x121/v2/{parent=projects/*/locations/*}/conversations\x12\xDA\x01\x0A\x0FGetConversation\x122.google.cloud.dialogflow.v2.GetConversationRequest\x1A(.google.cloud.dialogflow.v2.Conversation\"i\xDAA\x04name\x82\xD3\xE4\x93\x02\\\x12%/v2/{name=projects/*/conversations/*}Z3\x121/v2/{name=projects/*/locations/*/conversations/*}\x12\xFD\x01\x0A\x14CompleteConversation\x127.google.cloud.dialogflow.v2.CompleteConversationRequest\x1A(.google.cloud.dialogflow.v2.Conversation\"\x81\x01\xDAA\x04name\x82\xD3\xE4\x93\x02t\"./v2/{name=projects/*/conversations/*}:complete:\x01*Z?\":/v2/{name=projects/*/locations/*/conversations/*}:complete:\x01*\x12\x92\x02\x0A\x17IngestContextReferences\x12:.google.cloud.dialogflow.v2.IngestContextReferencesRequest\x1A;.google.cloud.dialogflow.v2.IngestContextReferencesResponse\"~\xDAA\x1Fconversation,context_references\x82\xD3\xE4\x93\x02V\"Q/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences:\x01*\x12\xF5\x01\x0A\x0CListMessages\x12/.google.cloud.dialogflow.v2.ListMessagesRequest\x1A0.google.cloud.dialogflow.v2.ListMessagesResponse\"\x81\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02r\x120/v2/{parent=projects/*/conversations/*}/messagesZ>\x12.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse\"\xD6\x01\xDAA\x0Cconversation\x82\xD3\xE4\x93\x02\xC0\x01\"T/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary:\x01*Ze\"`/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary:\x01*\x12\xDD\x02\x0A\x18GenerateStatelessSummary\x12;.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest\x1A<.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse\"\xC5\x01\x82\xD3\xE4\x93\x02\xBE\x01\"S/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary:\x01*Zd\"_/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary:\x01*\x12\xEB\x01\x0A\x1BGenerateStatelessSuggestion\x12>.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest\x1A?.google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse\"K\x82\xD3\xE4\x93\x02E\"@/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate:\x01*\x12\xAE\x03\x0A\x0FSearchKnowledge\x122.google.cloud.dialogflow.v2.SearchKnowledgeRequest\x1A3.google.cloud.dialogflow.v2.SearchKnowledgeResponse\"\xB1\x02\x82\xD3\xE4\x93\x02\xAA\x02\"3/v2/{parent=projects/*}/suggestions:searchKnowledge:\x01*ZD\"?/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge:\x01*ZN\"I/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge:\x01*ZZ\"U/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge:\x01*\x12\xBB\x02\x0A\x13GenerateSuggestions\x126.google.cloud.dialogflow.v2.GenerateSuggestionsRequest\x1A7.google.cloud.dialogflow.v2.GenerateSuggestionsResponse\"\xB2\x01\xDAA\x0Cconversation\x82\xD3\xE4\x93\x02\x9C\x01\"B/v2/{conversation=projects/*/conversations/*}/suggestions:generate:\x01*ZS\"N/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xBD\x03\x0A\x1Ecom.google.cloud.dialogflow.v2B\x11ConversationProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAA\xC5\x01\x0A(discoveryengine.googleapis.com/DataStore\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\x12?projects/{project}/locations/{location}/dataStores/{data_store}\xEAAZ\x0A\x17ces.googleapis.com/Tool\x12?projects/{project}/locations/{location}/apps/{app}/tools/{tool}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php new file mode 100644 index 000000000000..c651dd2ce85b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + "\x0A\xDE \x0A5google/cloud/dialogflow/v2/conversation_dataset.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\$google/cloud/dialogflow/v2/gcs.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x17google/rpc/status.proto\".\x0A\x10ConversationInfo\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x01\"U\x0A\x0BInputConfig\x12<\x0A\x0Agcs_source\x18\x01 \x01(\x0B2&.google.cloud.dialogflow.v2.GcsSourcesH\x00B\x08\x0A\x06source\"\xB7\x04\x0A\x13ConversationDataset\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bdescription\x18\x03 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12B\x0A\x0Cinput_config\x18\x05 \x01(\x0B2'.google.cloud.dialogflow.v2.InputConfigB\x03\xE0A\x03\x12L\x0A\x11conversation_info\x18\x06 \x01(\x0B2,.google.cloud.dialogflow.v2.ConversationInfoB\x03\xE0A\x03\x12\x1F\x0A\x12conversation_count\x18\x07 \x01(\x03B\x03\xE0A\x03\x12\x1F\x0A\x0Dsatisfies_pzi\x18\x08 \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01\x12\x1F\x0A\x0Dsatisfies_pzs\x18\x09 \x01(\x08B\x03\xE0A\x03H\x01\x88\x01\x01:\x88\x01\xEAA\x84\x01\x0A-dialogflow.googleapis.com/ConversationDataset\x12Sprojects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}B\x10\x0A\x0E_satisfies_pziB\x10\x0A\x0E_satisfies_pzs\"\x8B\x01\x0A CreateConversationDatasetRequest\x12\x13\x0A\x06parent\x18\x01 \x01(\x09B\x03\xE0A\x02\x12R\x0A\x14conversation_dataset\x18\x02 \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationDatasetB\x03\xE0A\x02\"d\x0A\x1DGetConversationDatasetRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\"\x99\x01\x0A\x1FListConversationDatasetsRequest\x12E\x0A\x06parent\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x12-dialogflow.googleapis.com/ConversationDataset\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"\x8B\x01\x0A ListConversationDatasetsResponse\x12N\x0A\x15conversation_datasets\x18\x01 \x03(\x0B2/.google.cloud.dialogflow.v2.ConversationDataset\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"g\x0A DeleteConversationDatasetRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\"\xA8\x01\x0A\x1DImportConversationDataRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\x12B\x0A\x0Cinput_config\x18\x02 \x01(\x0B2'.google.cloud.dialogflow.v2.InputConfigB\x03\xE0A\x02\"\xDA\x01\x0A'ImportConversationDataOperationMetadata\x12P\x0A\x14conversation_dataset\x18\x01 \x01(\x09B2\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\x12,\x0A\x10partial_failures\x18\x02 \x03(\x0B2\x12.google.rpc.Status\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\"\x91\x01\x0A'ImportConversationDataOperationResponse\x12P\x0A\x14conversation_dataset\x18\x01 \x01(\x09B2\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\x12\x14\x0A\x0Cimport_count\x18\x03 \x01(\x05\"~\x0A*CreateConversationDatasetOperationMetadata\x12P\x0A\x14conversation_dataset\x18\x01 \x01(\x09B2\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\",\x0A*DeleteConversationDatasetOperationMetadata2\xD6\x0C\x0A\x14ConversationDatasets\x12\xB3\x02\x0A\x19CreateConversationDataset\x12<.google.cloud.dialogflow.v2.CreateConversationDatasetRequest\x1A\x1D.google.longrunning.Operation\"\xB8\x01\xCAAA\x0A\x13ConversationDataset\x12*CreateConversationDatasetOperationMetadata\xDAA\x1Bparent,conversation_dataset\x82\xD3\xE4\x93\x02P\"8/v2/{parent=projects/*/locations/*}/conversationDatasets:\x14conversation_dataset\x12\xFD\x01\x0A\x16GetConversationDataset\x129.google.cloud.dialogflow.v2.GetConversationDatasetRequest\x1A/.google.cloud.dialogflow.v2.ConversationDataset\"w\xDAA\x04name\x82\xD3\xE4\x93\x02j\x12,/v2/{name=projects/*/conversationDatasets/*}Z:\x128/v2/{name=projects/*/locations/*/conversationDatasets/*}\x12\x90\x02\x0A\x18ListConversationDatasets\x12;.google.cloud.dialogflow.v2.ListConversationDatasetsRequest\x1A<.google.cloud.dialogflow.v2.ListConversationDatasetsResponse\"y\xDAA\x06parent\x82\xD3\xE4\x93\x02j\x12,/v2/{parent=projects/*}/conversationDatasetsZ:\x128/v2/{parent=projects/*/locations/*}/conversationDatasets\x12\x88\x02\x0A\x19DeleteConversationDataset\x12<.google.cloud.dialogflow.v2.DeleteConversationDatasetRequest\x1A\x1D.google.longrunning.Operation\"\x8D\x01\xCAAC\x0A\x15google.protobuf.Empty\x12*DeleteConversationDatasetOperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02:*8/v2/{name=projects/*/locations/*/conversationDatasets/*}\x12\xEF\x02\x0A\x16ImportConversationData\x129.google.cloud.dialogflow.v2.ImportConversationDataRequest\x1A\x1D.google.longrunning.Operation\"\xFA\x01\xCAAR\x0A'ImportConversationDataOperationResponse\x12'ImportConversationDataOperationMetadata\x82\xD3\xE4\x93\x02\x9E\x01\"C/v2/{name=projects/*/conversationDatasets/*}:importConversationData:\x01*ZT\"O/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9E\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x18ConversationDatasetProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationEvent.php new file mode 100644 index 000000000000..26215e03ca6c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationEvent.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + "\x0A\x86\x07\x0A3google/cloud/dialogflow/v2/conversation_event.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\x1A,google/cloud/dialogflow/v2/participant.proto\x1A(google/cloud/dialogflow/v2/session.proto\x1A\x17google/rpc/status.proto\"\xFF\x03\x0A\x11ConversationEvent\x12\x14\x0A\x0Cconversation\x18\x01 \x01(\x09\x12@\x0A\x04type\x18\x02 \x01(\x0E22.google.cloud.dialogflow.v2.ConversationEvent.Type\x12(\x0A\x0Cerror_status\x18\x03 \x01(\x0B2\x12.google.rpc.Status\x12B\x0A\x13new_message_payload\x18\x04 \x01(\x0B2#.google.cloud.dialogflow.v2.MessageH\x00\x12`\x0A\x1Enew_recognition_result_payload\x18\x05 \x01(\x0B26.google.cloud.dialogflow.v2.StreamingRecognitionResultH\x00\"\xB6\x01\x0A\x04Type\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x18\x0A\x14CONVERSATION_STARTED\x10\x01\x12\x19\x0A\x15CONVERSATION_FINISHED\x10\x02\x12\x1D\x0A\x19HUMAN_INTERVENTION_NEEDED\x10\x03\x12\x0F\x0A\x0BNEW_MESSAGE\x10\x05\x12\x1A\x0A\x16NEW_RECOGNITION_RESULT\x10\x07\x12\x17\x0A\x13UNRECOVERABLE_ERROR\x10\x04B\x09\x0A\x07payloadB\x9C\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x16ConversationEventProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationModel.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationModel.php new file mode 100644 index 000000000000..5be2917e95d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationModel.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + "\x0A\xB0B\x0A3google/cloud/dialogflow/v2/conversation_model.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x8D\x08\x0A\x11ConversationModel\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x124\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12?\x0A\x08datasets\x18\x04 \x03(\x0B2(.google.cloud.dialogflow.v2.InputDatasetB\x03\xE0A\x02\x12G\x0A\x05state\x18\x07 \x01(\x0E23.google.cloud.dialogflow.v2.ConversationModel.StateB\x03\xE0A\x03\x12\x15\x0A\x0Dlanguage_code\x18\x13 \x01(\x09\x12g\x0A!article_suggestion_model_metadata\x18\x08 \x01(\x0B2:.google.cloud.dialogflow.v2.ArticleSuggestionModelMetadataH\x00\x12Y\x0A\x1Asmart_reply_model_metadata\x18\x09 \x01(\x0B23.google.cloud.dialogflow.v2.SmartReplyModelMetadataH\x00\x12\x1F\x0A\x0Dsatisfies_pzs\x18\x19 \x01(\x08B\x03\xE0A\x03H\x01\x88\x01\x01\x12\x1F\x0A\x0Dsatisfies_pzi\x18\x1A \x01(\x08B\x03\xE0A\x03H\x02\x88\x01\x01\"\x91\x01\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08CREATING\x10\x01\x12\x0E\x0A\x0AUNDEPLOYED\x10\x02\x12\x0D\x0A\x09DEPLOYING\x10\x03\x12\x0C\x0A\x08DEPLOYED\x10\x04\x12\x0F\x0A\x0BUNDEPLOYING\x10\x05\x12\x0C\x0A\x08DELETING\x10\x06\x12\x0A\x0A\x06FAILED\x10\x07\x12\x0B\x0A\x07PENDING\x10\x08\"g\x0A\x09ModelType\x12\x1A\x0A\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\"\x0A\x1ESMART_REPLY_DUAL_ENCODER_MODEL\x10\x02\x12\x1A\x0A\x16SMART_REPLY_BERT_MODEL\x10\x06:\xBE\x01\xEAA\xBA\x01\x0A+dialogflow.googleapis.com/ConversationModel\x12Oprojects/{project}/locations/{location}/conversationModels/{conversation_model}\x12:projects/{project}/conversationModels/{conversation_model}B\x10\x0A\x0Emodel_metadataB\x10\x0A\x0E_satisfies_pzsB\x10\x0A\x0E_satisfies_pzi\"\xCF\x04\x0A\x1BConversationModelEvaluation\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x01\x12L\x0A\x11evaluation_config\x18\x06 \x01(\x0B2,.google.cloud.dialogflow.v2.EvaluationConfigB\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12Q\x0A\x13smart_reply_metrics\x18\x05 \x01(\x0B2-.google.cloud.dialogflow.v2.SmartReplyMetricsB\x03\xE0A\x03H\x00\x12(\x0A\x1Braw_human_eval_template_csv\x18\x08 \x01(\x09B\x03\xE0A\x03:\xFA\x01\xEAA\xF6\x01\x0A5dialogflow.googleapis.com/ConversationModelEvaluation\x12Sprojects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}\x12hprojects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}B\x09\x0A\x07metrics\"\x9C\x04\x0A\x10EvaluationConfig\x12?\x0A\x08datasets\x18\x03 \x03(\x0B2(.google.cloud.dialogflow.v2.InputDatasetB\x03\xE0A\x02\x12[\x0A\x12smart_reply_config\x18\x02 \x01(\x0B2=.google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfigH\x00\x12_\x0A\x14smart_compose_config\x18\x04 \x01(\x0B2?.google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfigH\x00\x1Av\x0A\x10SmartReplyConfig\x12C\x0A\x12allowlist_document\x18\x01 \x01(\x09B'\xFAA\$\x0A\"dialogflow.googleapis.com/Document\x12\x1D\x0A\x10max_result_count\x18\x02 \x01(\x05B\x03\xE0A\x02\x1Ax\x0A\x12SmartComposeConfig\x12C\x0A\x12allowlist_document\x18\x01 \x01(\x09B'\xFAA\$\x0A\"dialogflow.googleapis.com/Document\x12\x1D\x0A\x10max_result_count\x18\x02 \x01(\x05B\x03\xE0A\x02B\x17\x0A\x15model_specific_config\"V\x0A\x0CInputDataset\x12F\x0A\x07dataset\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationDataset\"{\x0A\x1EArticleSuggestionModelMetadata\x12Y\x0A\x13training_model_type\x18\x03 \x01(\x0E27.google.cloud.dialogflow.v2.ConversationModel.ModelTypeB\x03\xE0A\x01\"t\x0A\x17SmartReplyModelMetadata\x12Y\x0A\x13training_model_type\x18\x06 \x01(\x0E27.google.cloud.dialogflow.v2.ConversationModel.ModelTypeB\x03\xE0A\x01\"\xC7\x01\x0A\x11SmartReplyMetrics\x12\x1A\x0A\x12allowlist_coverage\x18\x01 \x01(\x02\x12P\x0A\x0Dtop_n_metrics\x18\x02 \x03(\x0B29.google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics\x12\x1A\x0A\x12conversation_count\x18\x03 \x01(\x03\x1A(\x0A\x0BTopNMetrics\x12\x09\x0A\x01n\x18\x01 \x01(\x05\x12\x0E\x0A\x06recall\x18\x02 \x01(\x02\"\x80\x01\x0A\x1ECreateConversationModelRequest\x12\x0E\x0A\x06parent\x18\x01 \x01(\x09\x12N\x0A\x12conversation_model\x18\x02 \x01(\x0B2-.google.cloud.dialogflow.v2.ConversationModelB\x03\xE0A\x02\"0\x0A\x1BGetConversationModelRequest\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\"e\x0A\x1DListConversationModelsRequest\x12\x13\x0A\x06parent\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"\x85\x01\x0A\x1EListConversationModelsResponse\x12J\x0A\x13conversation_models\x18\x01 \x03(\x0B2-.google.cloud.dialogflow.v2.ConversationModel\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"3\x0A\x1EDeleteConversationModelRequest\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\"3\x0A\x1EDeployConversationModelRequest\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\"5\x0A UndeployConversationModelRequest\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\":\x0A%GetConversationModelEvaluationRequest\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\"o\x0A'ListConversationModelEvaluationsRequest\x12\x13\x0A\x06parent\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"\xA4\x01\x0A(ListConversationModelEvaluationsResponse\x12_\x0A\x1Econversation_model_evaluations\x18\x01 \x03(\x0B27.google.cloud.dialogflow.v2.ConversationModelEvaluation\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\xDE\x01\x0A(CreateConversationModelEvaluationRequest\x12M\x0A\x06parent\x18\x01 \x01(\x09B=\xE0A\x02\xFAA7\x125dialogflow.googleapis.com/ConversationModelEvaluation\x12c\x0A\x1Dconversation_model_evaluation\x18\x02 \x01(\x0B27.google.cloud.dialogflow.v2.ConversationModelEvaluationB\x03\xE0A\x02\"\xF6\x02\x0A(CreateConversationModelOperationMetadata\x12\x1A\x0A\x12conversation_model\x18\x01 \x01(\x09\x12Y\x0A\x05state\x18\x02 \x01(\x0E2J.google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12-\x0A\x09done_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.Timestamp\"s\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07PENDING\x10\x01\x12\x0D\x0A\x09SUCCEEDED\x10\x02\x12\x0A\x0A\x06FAILED\x10\x03\x12\x0D\x0A\x09CANCELLED\x10\x04\x12\x0E\x0A\x0ACANCELLING\x10\x05\x12\x0C\x0A\x08TRAINING\x10\x06\"\xA6\x01\x0A(DeployConversationModelOperationMetadata\x12\x1A\x0A\x12conversation_model\x18\x01 \x01(\x09\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12-\x0A\x09done_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.Timestamp\"\xA8\x01\x0A*UndeployConversationModelOperationMetadata\x12\x1A\x0A\x12conversation_model\x18\x01 \x01(\x09\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12-\x0A\x09done_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.Timestamp\"\xA6\x01\x0A(DeleteConversationModelOperationMetadata\x12\x1A\x0A\x12conversation_model\x18\x01 \x01(\x09\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12-\x0A\x09done_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.Timestamp\"\xF6\x02\x0A2CreateConversationModelEvaluationOperationMetadata\x12%\x0A\x1Dconversation_model_evaluation\x18\x01 \x01(\x09\x12\x1A\x0A\x12conversation_model\x18\x04 \x01(\x09\x12c\x0A\x05state\x18\x02 \x01(\x0E2T.google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\"g\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x10\x0A\x0CINITIALIZING\x10\x01\x12\x0B\x0A\x07RUNNING\x10\x02\x12\x0D\x0A\x09CANCELLED\x10\x03\x12\x0D\x0A\x09SUCCEEDED\x10\x04\x12\x0A\x0A\x06FAILED\x10\x052\xFE\x16\x0A\x12ConversationModels\x12\xE8\x02\x0A\x17CreateConversationModel\x12:.google.cloud.dialogflow.v2.CreateConversationModelRequest\x1A\x1D.google.longrunning.Operation\"\xF1\x01\xCAA=\x0A\x11ConversationModel\x12(CreateConversationModelOperationMetadata\xDAA\x19parent,conversation_model\x82\xD3\xE4\x93\x02\x8E\x01\"*/v2/{parent=projects/*}/conversationModels:\x12conversation_modelZL\"6/v2/{parent=projects/*/locations/*}/conversationModels:\x12conversation_model\x12\xF3\x01\x0A\x14GetConversationModel\x127.google.cloud.dialogflow.v2.GetConversationModelRequest\x1A-.google.cloud.dialogflow.v2.ConversationModel\"s\xDAA\x04name\x82\xD3\xE4\x93\x02f\x12*/v2/{name=projects/*/conversationModels/*}Z8\x126/v2/{name=projects/*/locations/*/conversationModels/*}\x12\x86\x02\x0A\x16ListConversationModels\x129.google.cloud.dialogflow.v2.ListConversationModelsRequest\x1A:.google.cloud.dialogflow.v2.ListConversationModelsResponse\"u\xDAA\x06parent\x82\xD3\xE4\x93\x02f\x12*/v2/{parent=projects/*}/conversationModelsZ8\x126/v2/{parent=projects/*/locations/*}/conversationModels\x12\xAE\x02\x0A\x17DeleteConversationModel\x12:.google.cloud.dialogflow.v2.DeleteConversationModelRequest\x1A\x1D.google.longrunning.Operation\"\xB7\x01\xCAAA\x0A\x15google.protobuf.Empty\x12(DeleteConversationModelOperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02f**/v2/{name=projects/*/conversationModels/*}Z8*6/v2/{name=projects/*/locations/*/conversationModels/*}\x12\xBB\x02\x0A\x17DeployConversationModel\x12:.google.cloud.dialogflow.v2.DeployConversationModelRequest\x1A\x1D.google.longrunning.Operation\"\xC4\x01\xCAAA\x0A\x15google.protobuf.Empty\x12(DeployConversationModelOperationMetadata\x82\xD3\xE4\x93\x02z\"1/v2/{name=projects/*/conversationModels/*}:deploy:\x01*ZB\"=/v2/{name=projects/*/locations/*/conversationModels/*}:deploy:\x01*\x12\xC5\x02\x0A\x19UndeployConversationModel\x12<.google.cloud.dialogflow.v2.UndeployConversationModelRequest\x1A\x1D.google.longrunning.Operation\"\xCA\x01\xCAAC\x0A\x15google.protobuf.Empty\x12*UndeployConversationModelOperationMetadata\x82\xD3\xE4\x93\x02~\"3/v2/{name=projects/*/conversationModels/*}:undeploy:\x01*ZD\"?/v2/{name=projects/*/locations/*/conversationModels/*}:undeploy:\x01*\x12\xAF\x02\x0A\x1EGetConversationModelEvaluation\x12A.google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest\x1A7.google.cloud.dialogflow.v2.ConversationModelEvaluation\"\x90\x01\xDAA\x04name\x82\xD3\xE4\x93\x02\x82\x01\x128/v2/{name=projects/*/conversationModels/*/evaluations/*}ZF\x12D/v2/{name=projects/*/locations/*/conversationModels/*/evaluations/*}\x12\xC2\x02\x0A ListConversationModelEvaluations\x12C.google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest\x1AD.google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse\"\x92\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02\x82\x01\x128/v2/{parent=projects/*/conversationModels/*}/evaluationsZF\x12D/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations\x12\xD5\x02\x0A!CreateConversationModelEvaluation\x12D.google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest\x1A\x1D.google.longrunning.Operation\"\xCA\x01\xCAAQ\x0A\x1BConversationModelEvaluation\x122CreateConversationModelEvaluationOperationMetadata\xDAA\$parent,conversation_model_evaluation\x82\xD3\xE4\x93\x02I\"D/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9C\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x16ConversationModelProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationProfile.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationProfile.php new file mode 100644 index 000000000000..4ca698f9bd63 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationProfile.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + "\x0A\xD0]\x0A5google/cloud/dialogflow/v2/conversation_profile.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A-google/cloud/dialogflow/v2/audio_config.proto\x1A*google/cloud/dialogflow/v2/generator.proto\x1A,google/cloud/dialogflow/v2/participant.proto\x1A#google/longrunning/operations.proto\x1A\x1Egoogle/protobuf/duration.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x99\x0A\x0A\x13ConversationProfile\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x124\x0A\x0Bcreate_time\x18\x0B \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x0C \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12P\x0A\x16automated_agent_config\x18\x03 \x01(\x0B20.google.cloud.dialogflow.v2.AutomatedAgentConfig\x12[\x0A\x1Chuman_agent_assistant_config\x18\x04 \x01(\x0B25.google.cloud.dialogflow.v2.HumanAgentAssistantConfig\x12W\x0A\x1Ahuman_agent_handoff_config\x18\x05 \x01(\x0B23.google.cloud.dialogflow.v2.HumanAgentHandoffConfig\x12K\x0A\x13notification_config\x18\x06 \x01(\x0B2..google.cloud.dialogflow.v2.NotificationConfig\x12A\x0A\x0Elogging_config\x18\x07 \x01(\x0B2).google.cloud.dialogflow.v2.LoggingConfig\x12]\x0A%new_message_event_notification_config\x18\x08 \x01(\x0B2..google.cloud.dialogflow.v2.NotificationConfig\x12g\x0A*new_recognition_result_notification_config\x18\x15 \x01(\x0B2..google.cloud.dialogflow.v2.NotificationConfigB\x03\xE0A\x01\x12B\x0A\x0Astt_config\x18\x09 \x01(\x0B2..google.cloud.dialogflow.v2.SpeechToTextConfig\x12\x15\x0A\x0Dlanguage_code\x18\x0A \x01(\x09\x12>\x0A\x0Asip_config\x18\x10 \x01(\x0B2%.google.cloud.dialogflow.v2.SipConfigB\x03\xE0A\x01\x12\x11\x0A\x09time_zone\x18\x0E \x01(\x09\x12L\x0A\x11security_settings\x18\x0D \x01(\x09B1\xFAA.\x0A,dialogflow.googleapis.com/CXSecuritySettings\x12F\x0A\x0Atts_config\x18\x12 \x01(\x0B22.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\xC8\x01\xEAA\xC4\x01\x0A-dialogflow.googleapis.com/ConversationProfile\x12>projects/{project}/conversationProfiles/{conversation_profile}\x12Sprojects/{project}/locations/{location}/conversationProfiles/{conversation_profile}\"\x8F\x01\x0A\x1FListConversationProfilesRequest\x12E\x0A\x06parent\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x12-dialogflow.googleapis.com/ConversationProfile\x12\x11\x0A\x09page_size\x18\x02 \x01(\x05\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\"\x8B\x01\x0A ListConversationProfilesResponse\x12N\x0A\x15conversation_profiles\x18\x01 \x03(\x0B2/.google.cloud.dialogflow.v2.ConversationProfile\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"d\x0A\x1DGetConversationProfileRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationProfile\"\xBD\x01\x0A CreateConversationProfileRequest\x12E\x0A\x06parent\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x12-dialogflow.googleapis.com/ConversationProfile\x12R\x0A\x14conversation_profile\x18\x02 \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xE0A\x02\"\xAC\x01\x0A UpdateConversationProfileRequest\x12R\x0A\x14conversation_profile\x18\x01 \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\"g\x0A DeleteConversationProfileRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/ConversationProfile\"\x83\x01\x0A\x14AutomatedAgentConfig\x126\x0A\x05agent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x0A\x1Fdialogflow.googleapis.com/Agent\x123\x0A\x0Bsession_ttl\x18\x03 \x01(\x0B2\x19.google.protobuf.DurationB\x03\xE0A\x01\"\xEE\x1E\x0A\x19HumanAgentAssistantConfig\x12K\x0A\x13notification_config\x18\x02 \x01(\x0B2..google.cloud.dialogflow.v2.NotificationConfig\x12m\x0A\x1Dhuman_agent_suggestion_config\x18\x03 \x01(\x0B2F.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12j\x0A\x1Aend_user_suggestion_config\x18\x04 \x01(\x0B2F.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12l\x0A\x17message_analysis_config\x18\x05 \x01(\x0B2K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig\x1AH\x0A\x19SuggestionTriggerSettings\x12\x14\x0A\x0Cno_smalltalk\x18\x01 \x01(\x08\x12\x15\x0A\x0Donly_end_user\x18\x02 \x01(\x08\x1A\xF1\x07\x0A\x17SuggestionFeatureConfig\x12I\x0A\x12suggestion_feature\x18\x05 \x01(\x0B2-.google.cloud.dialogflow.v2.SuggestionFeature\x12%\x0A\x1Denable_event_based_suggestion\x18\x03 \x01(\x08\x12(\x0A\x1Bdisable_agent_query_logging\x18\x0E \x01(\x08B\x03\xE0A\x01\x123\x0A&enable_query_suggestion_when_no_answer\x18\x0F \x01(\x08B\x03\xE0A\x01\x120\x0A#enable_conversation_augmented_query\x18\x10 \x01(\x08B\x03\xE0A\x01\x12)\x0A\x1Cenable_query_suggestion_only\x18\x11 \x01(\x08B\x03\xE0A\x01\x12'\x0A\x1Aenable_response_debug_info\x18\x12 \x01(\x08B\x03\xE0A\x01\x12B\x0A\x0Crai_settings\x18\x13 \x01(\x0B2'.google.cloud.dialogflow.v2.RaiSettingsB\x03\xE0A\x01\x12O\x0A\x18suggestion_trigger_event\x18\x14 \x01(\x0E2(.google.cloud.dialogflow.v2.TriggerEventB\x03\xE0A\x01\x12)\x0A\x1Cdisable_query_search_context\x18\x15 \x01(\x08B\x03\xE0A\x01\x12t\x0A\x1Bsuggestion_trigger_settings\x18\x0A \x01(\x0B2O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings\x12a\x0A\x0Cquery_config\x18\x06 \x01(\x0B2K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig\x12p\x0A\x19conversation_model_config\x18\x07 \x01(\x0B2M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig\x12t\x0A\x1Bconversation_process_config\x18\x08 \x01(\x0B2O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig\x1A\x9D\x03\x0A\x10SuggestionConfig\x12f\x0A\x0Ffeature_configs\x18\x02 \x03(\x0B2M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig\x12\"\x0A\x1Agroup_suggestion_responses\x18\x03 \x01(\x08\x12?\x0A\x0Agenerators\x18\x04 \x03(\x09B+\xE0A\x01\xFAA%\x0A#dialogflow.googleapis.com/Generator\x128\x0A+disable_high_latency_features_sync_delivery\x18\x05 \x01(\x08B\x03\xE0A\x01\x12.\x0A!skip_empty_event_based_suggestion\x18\x06 \x01(\x08B\x03\xE0A\x01\x12-\x0A use_unredacted_conversation_data\x18\x08 \x01(\x08B\x03\xE0A\x01\x12#\x0A\x16enable_async_tool_call\x18\x09 \x01(\x08B\x03\xE0A\x01\x1A\x99\x0D\x0A\x15SuggestionQueryConfig\x12\x8B\x01\x0A\x1Bknowledge_base_query_source\x18\x01 \x01(\x0B2d.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySourceH\x00\x12\x80\x01\x0A\x15document_query_source\x18\x02 \x01(\x0B2_.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySourceH\x00\x12\x84\x01\x0A\x17dialogflow_query_source\x18\x03 \x01(\x0B2a.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySourceH\x00\x12\x13\x0A\x0Bmax_results\x18\x04 \x01(\x05\x12\x1C\x0A\x14confidence_threshold\x18\x05 \x01(\x02\x12\x82\x01\x0A\x17context_filter_settings\x18\x07 \x01(\x0B2a.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings\x12k\x0A\x08sections\x18\x08 \x01(\x0B2T.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.SectionsB\x03\xE0A\x01\x12\x19\x0A\x0Ccontext_size\x18\x09 \x01(\x05B\x03\xE0A\x01\x1Ad\x0A\x18KnowledgeBaseQuerySource\x12H\x0A\x0Fknowledge_bases\x18\x01 \x03(\x09B/\xE0A\x02\xFAA)\x0A'dialogflow.googleapis.com/KnowledgeBase\x1AT\x0A\x13DocumentQuerySource\x12=\x0A\x09documents\x18\x01 \x03(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/Document\x1A\xBE\x02\x0A\x15DialogflowQuerySource\x126\x0A\x05agent\x18\x01 \x01(\x09B'\xE0A\x02\xFAA!\x0A\x1Fdialogflow.googleapis.com/Agent\x12\x9C\x01\x0A\x17human_agent_side_config\x18\x03 \x01(\x0B2v.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfigB\x03\xE0A\x01\x1AN\x0A\x14HumanAgentSideConfig\x126\x0A\x05agent\x18\x01 \x01(\x09B'\xE0A\x01\xFAA!\x0A\x1Fdialogflow.googleapis.com/Agent\x1Av\x0A\x15ContextFilterSettings\x12\x1D\x0A\x15drop_handoff_messages\x18\x01 \x01(\x08\x12#\x0A\x1Bdrop_virtual_agent_messages\x18\x02 \x01(\x08\x12\x19\x0A\x11drop_ivr_messages\x18\x03 \x01(\x08\x1A\xA2\x02\x0A\x08Sections\x12w\x0A\x0Dsection_types\x18\x01 \x03(\x0E2`.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType\"\x9C\x01\x0A\x0BSectionType\x12\x1C\x0A\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09SITUATION\x10\x01\x12\x0A\x0A\x06ACTION\x10\x02\x12\x0E\x0A\x0ARESOLUTION\x10\x03\x12\x1B\x0A\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\x0A\x15CUSTOMER_SATISFACTION\x10\x05\x12\x0C\x0A\x08ENTITIES\x10\x06B\x0E\x0A\x0Cquery_source\x1Az\x0A\x17ConversationModelConfig\x12?\x0A\x05model\x18\x01 \x01(\x09B0\xFAA-\x0A+dialogflow.googleapis.com/ConversationModel\x12\x1E\x0A\x16baseline_model_version\x18\x08 \x01(\x09\x1A;\x0A\x19ConversationProcessConfig\x12\x1E\x0A\x16recent_sentences_count\x18\x02 \x01(\x05\x1A\x87\x01\x0A\x15MessageAnalysisConfig\x12 \x0A\x18enable_entity_extraction\x18\x02 \x01(\x08\x12!\x0A\x19enable_sentiment_analysis\x18\x03 \x01(\x08\x12)\x0A\x1Cenable_sentiment_analysis_v3\x18\x05 \x01(\x08B\x03\xE0A\x01\"\xC4\x03\x0A\x17HumanAgentHandoffConfig\x12b\x0A\x12live_person_config\x18\x01 \x01(\x0B2D.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfigH\x00\x12u\x0A\x1Csalesforce_live_agent_config\x18\x02 \x01(\x0B2M.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfigH\x00\x1A/\x0A\x10LivePersonConfig\x12\x1B\x0A\x0Eaccount_number\x18\x01 \x01(\x09B\x03\xE0A\x02\x1A\x8B\x01\x0A\x19SalesforceLiveAgentConfig\x12\x1C\x0A\x0Forganization_id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Ddeployment_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09button_id\x18\x03 \x01(\x09B\x03\xE0A\x02\x12\x1C\x0A\x0Fendpoint_domain\x18\x04 \x01(\x09B\x03\xE0A\x02B\x0F\x0A\x0Dagent_service\"\xBF\x01\x0A\x12NotificationConfig\x12\x0D\x0A\x05topic\x18\x01 \x01(\x09\x12T\x0A\x0Emessage_format\x18\x02 \x01(\x0E2<.google.cloud.dialogflow.v2.NotificationConfig.MessageFormat\"D\x0A\x0DMessageFormat\x12\x1E\x0A\x1AMESSAGE_FORMAT_UNSPECIFIED\x10\x00\x12\x09\x0A\x05PROTO\x10\x01\x12\x08\x0A\x04JSON\x10\x02\"3\x0A\x0DLoggingConfig\x12\"\x0A\x1Aenable_stackdriver_logging\x18\x03 \x01(\x08\"\xA8\x02\x0A\x09SipConfig\x12&\x0A\x1Ecreate_conversation_on_the_fly\x18\x01 \x01(\x08\x12\x16\x0A\x0Einactive_start\x18\x03 \x01(\x08\x12?\x0A\x1Cmax_audio_recording_duration\x18\x04 \x01(\x0B2\x19.google.protobuf.Duration\x12'\x0A\x1Fallow_virtual_agent_interaction\x18\x05 \x01(\x08\x12!\x0A\x19keep_conversation_running\x18\x06 \x01(\x08\x12%\x0A\x1Dcopy_inbound_call_leg_headers\x18\x08 \x03(\x09\x12'\x0A\x1Fignore_reinvite_media_direction\x18\x09 \x01(\x08\"\xF2\x01\x0A\x11SuggestionFeature\x12@\x0A\x04type\x18\x01 \x01(\x0E22.google.cloud.dialogflow.v2.SuggestionFeature.Type\"\x9A\x01\x0A\x04Type\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x16\x0A\x12ARTICLE_SUGGESTION\x10\x01\x12\x07\x0A\x03FAQ\x10\x02\x12\x0F\x0A\x0BSMART_REPLY\x10\x03\x12\x1E\x0A\x1ACONVERSATION_SUMMARIZATION\x10\x08\x12\x14\x0A\x10KNOWLEDGE_SEARCH\x10\x0E\x12\x14\x0A\x10KNOWLEDGE_ASSIST\x10\x0F\"\x8A\x02\x0A!SetSuggestionFeatureConfigRequest\x12!\x0A\x14conversation_profile\x18\x01 \x01(\x09B\x03\xE0A\x02\x12K\x0A\x10participant_role\x18\x02 \x01(\x0E2,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xE0A\x02\x12u\x0A\x19suggestion_feature_config\x18\x03 \x01(\x0B2M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfigB\x03\xE0A\x02\"\xEF\x01\x0A#ClearSuggestionFeatureConfigRequest\x12!\x0A\x14conversation_profile\x18\x01 \x01(\x09B\x03\xE0A\x02\x12K\x0A\x10participant_role\x18\x02 \x01(\x0E2,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xE0A\x02\x12X\x0A\x17suggestion_feature_type\x18\x03 \x01(\x0E22.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xE0A\x02\"\xA3\x02\x0A+SetSuggestionFeatureConfigOperationMetadata\x12\x1C\x0A\x14conversation_profile\x18\x01 \x01(\x09\x12K\x0A\x10participant_role\x18\x02 \x01(\x0E2,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xE0A\x02\x12X\x0A\x17suggestion_feature_type\x18\x03 \x01(\x0E22.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xE0A\x02\x12/\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.Timestamp\"\xA5\x02\x0A-ClearSuggestionFeatureConfigOperationMetadata\x12\x1C\x0A\x14conversation_profile\x18\x01 \x01(\x09\x12K\x0A\x10participant_role\x18\x02 \x01(\x0E2,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xE0A\x02\x12X\x0A\x17suggestion_feature_type\x18\x03 \x01(\x0E22.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xE0A\x02\x12/\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.Timestamp2\xB3\x14\x0A\x14ConversationProfiles\x12\x90\x02\x0A\x18ListConversationProfiles\x12;.google.cloud.dialogflow.v2.ListConversationProfilesRequest\x1A<.google.cloud.dialogflow.v2.ListConversationProfilesResponse\"y\xDAA\x06parent\x82\xD3\xE4\x93\x02j\x12,/v2/{parent=projects/*}/conversationProfilesZ:\x128/v2/{parent=projects/*/locations/*}/conversationProfiles\x12\xFD\x01\x0A\x16GetConversationProfile\x129.google.cloud.dialogflow.v2.GetConversationProfileRequest\x1A/.google.cloud.dialogflow.v2.ConversationProfile\"w\xDAA\x04name\x82\xD3\xE4\x93\x02j\x12,/v2/{name=projects/*/conversationProfiles/*}Z:\x128/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xC8\x02\x0A\x19CreateConversationProfile\x12<.google.cloud.dialogflow.v2.CreateConversationProfileRequest\x1A/.google.cloud.dialogflow.v2.ConversationProfile\"\xBB\x01\xDAA\x1Bparent,conversation_profile\x82\xD3\xE4\x93\x02\x96\x01\",/v2/{parent=projects/*}/conversationProfiles:\x14conversation_profileZP\"8/v2/{parent=projects/*/locations/*}/conversationProfiles:\x14conversation_profile\x12\xF7\x02\x0A\x19UpdateConversationProfile\x12<.google.cloud.dialogflow.v2.UpdateConversationProfileRequest\x1A/.google.cloud.dialogflow.v2.ConversationProfile\"\xEA\x01\xDAA conversation_profile,update_mask\x82\xD3\xE4\x93\x02\xC0\x012A/v2/{conversation_profile.name=projects/*/conversationProfiles/*}:\x14conversation_profileZe2M/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}:\x14conversation_profile\x12\xEA\x01\x0A\x19DeleteConversationProfile\x12<.google.cloud.dialogflow.v2.DeleteConversationProfileRequest\x1A\x16.google.protobuf.Empty\"w\xDAA\x04name\x82\xD3\xE4\x93\x02j*,/v2/{name=projects/*/conversationProfiles/*}Z:*8/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xE8\x03\x0A\x1ASetSuggestionFeatureConfig\x12=.google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest\x1A\x1D.google.longrunning.Operation\"\xEB\x02\xCAAB\x0A\x13ConversationProfile\x12+SetSuggestionFeatureConfigOperationMetadata\xDAA\x14conversation_profile\xDAA?conversation_profile,participant_role,suggestion_feature_config\x82\xD3\xE4\x93\x02\xC6\x01\"W/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*Zh\"c/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*\x12\xF0\x03\x0A\x1CClearSuggestionFeatureConfig\x12?.google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest\x1A\x1D.google.longrunning.Operation\"\xEF\x02\xCAAD\x0A\x13ConversationProfile\x12-ClearSuggestionFeatureConfigOperationMetadata\xDAA\x14conversation_profile\xDAA=conversation_profile,participant_role,suggestion_feature_type\x82\xD3\xE4\x93\x02\xCA\x01\"Y/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*Zj\"e/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9D\x02\x0A\x1Ecom.google.cloud.dialogflow.v2B\x18ConversationProfileProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAA|\x0A,dialogflow.googleapis.com/CXSecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php new file mode 100644 index 000000000000..fbe368580da8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + "\x0A\x8B4\x0A)google/cloud/dialogflow/v2/document.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\$google/cloud/dialogflow/v2/gcs.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x17google/rpc/status.proto\"\xA6\x08\x0A\x08Document\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09mime_type\x18\x03 \x01(\x09B\x03\xE0A\x02\x12P\x0A\x0Fknowledge_types\x18\x04 \x03(\x0E22.google.cloud.dialogflow.v2.Document.KnowledgeTypeB\x03\xE0A\x02\x12\x15\x0A\x0Bcontent_uri\x18\x05 \x01(\x09H\x00\x12\x15\x0A\x0Braw_content\x18\x09 \x01(\x0CH\x00\x12\x1F\x0A\x12enable_auto_reload\x18\x0B \x01(\x08B\x03\xE0A\x01\x12T\x0A\x14latest_reload_status\x18\x0C \x01(\x0B21.google.cloud.dialogflow.v2.Document.ReloadStatusB\x03\xE0A\x03\x12I\x0A\x08metadata\x18\x07 \x03(\x0B22.google.cloud.dialogflow.v2.Document.MetadataEntryB\x03\xE0A\x01\x12>\x0A\x05state\x18\x0D \x01(\x0E2*.google.cloud.dialogflow.v2.Document.StateB\x03\xE0A\x03\x1A\\\x0A\x0CReloadStatus\x12(\x0A\x04time\x18\x01 \x01(\x0B2\x1A.google.protobuf.Timestamp\x12\"\x0A\x06status\x18\x02 \x01(\x0B2\x12.google.rpc.Status\x1A/\x0A\x0DMetadataEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\x81\x01\x0A\x0DKnowledgeType\x12\x1E\x0A\x1AKNOWLEDGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\x0A\x03FAQ\x10\x01\x12\x11\x0A\x0DEXTRACTIVE_QA\x10\x02\x12\x16\x0A\x12ARTICLE_SUGGESTION\x10\x03\x12\x1C\x0A\x18AGENT_FACING_SMART_REPLY\x10\x04\"c\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08CREATING\x10\x01\x12\x0A\x0A\x06ACTIVE\x10\x02\x12\x0C\x0A\x08UPDATING\x10\x03\x12\x0D\x0A\x09RELOADING\x10\x04\x12\x0C\x0A\x08DELETING\x10\x05:\xCF\x01\xEAA\xCB\x01\x0A\"dialogflow.googleapis.com/Document\x12Gprojects/{project}/knowledgeBases/{knowledge_base}/documents/{document}\x12\\projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}B\x08\x0A\x06source\"N\x0A\x12GetDocumentRequest\x128\x0A\x04name\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/Document\"\x89\x01\x0A\x14ListDocumentsRequest\x12:\x0A\x06parent\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x12\"dialogflow.googleapis.com/Document\x12\x11\x0A\x09page_size\x18\x02 \x01(\x05\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\x12\x0E\x0A\x06filter\x18\x04 \x01(\x09\"i\x0A\x15ListDocumentsResponse\x127\x0A\x09documents\x18\x01 \x03(\x0B2\$.google.cloud.dialogflow.v2.Document\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\x90\x01\x0A\x15CreateDocumentRequest\x12:\x0A\x06parent\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x12\"dialogflow.googleapis.com/Document\x12;\x0A\x08document\x18\x02 \x01(\x0B2\$.google.cloud.dialogflow.v2.DocumentB\x03\xE0A\x02\"\x99\x02\x0A\x16ImportDocumentsRequest\x12:\x0A\x06parent\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x12\"dialogflow.googleapis.com/Document\x12A\x0A\x0Agcs_source\x18\x02 \x01(\x0B2&.google.cloud.dialogflow.v2.GcsSourcesB\x03\xE0A\x01H\x00\x12R\x0A\x11document_template\x18\x03 \x01(\x0B22.google.cloud.dialogflow.v2.ImportDocumentTemplateB\x03\xE0A\x02\x12\"\x0A\x1Aimport_gcs_custom_metadata\x18\x04 \x01(\x08B\x08\x0A\x06source\"\x87\x02\x0A\x16ImportDocumentTemplate\x12\x16\x0A\x09mime_type\x18\x01 \x01(\x09B\x03\xE0A\x02\x12P\x0A\x0Fknowledge_types\x18\x02 \x03(\x0E22.google.cloud.dialogflow.v2.Document.KnowledgeTypeB\x03\xE0A\x02\x12R\x0A\x08metadata\x18\x03 \x03(\x0B2@.google.cloud.dialogflow.v2.ImportDocumentTemplate.MetadataEntry\x1A/\x0A\x0DMetadataEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"?\x0A\x17ImportDocumentsResponse\x12\$\x0A\x08warnings\x18\x01 \x03(\x0B2\x12.google.rpc.Status\"Q\x0A\x15DeleteDocumentRequest\x128\x0A\x04name\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/Document\"\x8A\x01\x0A\x15UpdateDocumentRequest\x12;\x0A\x08document\x18\x01 \x01(\x0B2\$.google.cloud.dialogflow.v2.DocumentB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"\xCD\x01\x0A\x15ReloadDocumentRequest\x128\x0A\x04name\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/Document\x12\x1A\x0A\x0Bcontent_uri\x18\x03 \x01(\x09B\x03\xE0A\x01H\x00\x12'\x0A\x1Aimport_gcs_custom_metadata\x18\x04 \x01(\x08B\x03\xE0A\x01\x12+\x0A\x1Esmart_messaging_partial_update\x18\x05 \x01(\x08B\x03\xE0A\x01B\x08\x0A\x06source\"\xEC\x01\x0A\x15ExportDocumentRequest\x128\x0A\x04name\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/Document\x12E\x0A\x0Fgcs_destination\x18\x02 \x01(\x0B2*.google.cloud.dialogflow.v2.GcsDestinationH\x00\x12\x1B\x0A\x13export_full_content\x18\x03 \x01(\x08\x12&\x0A\x1Esmart_messaging_partial_update\x18\x05 \x01(\x08B\x0D\x0A\x0Bdestination\"g\x0A\x17ExportOperationMetadata\x12L\x0A\x18exported_gcs_destination\x18\x01 \x01(\x0B2*.google.cloud.dialogflow.v2.GcsDestination\"\xE9\x02\x0A\x1AKnowledgeOperationMetadata\x12P\x0A\x05state\x18\x01 \x01(\x0E2<.google.cloud.dialogflow.v2.KnowledgeOperationMetadata.StateB\x03\xE0A\x03\x12\x16\x0A\x0Eknowledge_base\x18\x03 \x01(\x09\x12X\x0A\x19export_operation_metadata\x18\x04 \x01(\x0B23.google.cloud.dialogflow.v2.ExportOperationMetadataH\x00\x12-\x0A\x09done_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.Timestamp\"B\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07PENDING\x10\x01\x12\x0B\x0A\x07RUNNING\x10\x02\x12\x08\x0A\x04DONE\x10\x03B\x14\x0A\x12operation_metadata2\xAC\x16\x0A\x09Documents\x12\xB9\x02\x0A\x0DListDocuments\x120.google.cloud.dialogflow.v2.ListDocumentsRequest\x1A1.google.cloud.dialogflow.v2.ListDocumentsResponse\"\xC2\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02\xB2\x01\x122/v2/{parent=projects/*/knowledgeBases/*}/documentsZ@\x12>/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documentsZ:\x128/v2/{parent=projects/*/agent/knowledgeBases/*}/documents\x12\xA6\x02\x0A\x0BGetDocument\x12..google.cloud.dialogflow.v2.GetDocumentRequest\x1A\$.google.cloud.dialogflow.v2.Document\"\xC0\x01\xDAA\x04name\x82\xD3\xE4\x93\x02\xB2\x01\x122/v2/{name=projects/*/knowledgeBases/*/documents/*}Z@\x12>/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}Z:\x128/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}\x12\xF7\x02\x0A\x0ECreateDocument\x121.google.cloud.dialogflow.v2.CreateDocumentRequest\x1A\x1D.google.longrunning.Operation\"\x92\x02\xCAA&\x0A\x08Document\x12\x1AKnowledgeOperationMetadata\xDAA\x0Fparent,document\x82\xD3\xE4\x93\x02\xD0\x01\"2/v2/{parent=projects/*/knowledgeBases/*}/documents:\x08documentZJ\">/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:\x08documentZD\"8/v2/{parent=projects/*/agent/knowledgeBases/*}/documents:\x08document\x12\xB0\x02\x0A\x0FImportDocuments\x122.google.cloud.dialogflow.v2.ImportDocumentsRequest\x1A\x1D.google.longrunning.Operation\"\xC9\x01\xCAA5\x0A\x17ImportDocumentsResponse\x12\x1AKnowledgeOperationMetadata\x82\xD3\xE4\x93\x02\x8A\x01\"9/v2/{parent=projects/*/knowledgeBases/*}/documents:import:\x01*ZJ\"E/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import:\x01*\x12\xDB\x02\x0A\x0EDeleteDocument\x121.google.cloud.dialogflow.v2.DeleteDocumentRequest\x1A\x1D.google.longrunning.Operation\"\xF6\x01\xCAA3\x0A\x15google.protobuf.Empty\x12\x1AKnowledgeOperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02\xB2\x01*2/v2/{name=projects/*/knowledgeBases/*/documents/*}Z@*>/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}Z:*8/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}\x12\x97\x03\x0A\x0EUpdateDocument\x121.google.cloud.dialogflow.v2.UpdateDocumentRequest\x1A\x1D.google.longrunning.Operation\"\xB2\x02\xCAA&\x0A\x08Document\x12\x1AKnowledgeOperationMetadata\xDAA\x14document,update_mask\x82\xD3\xE4\x93\x02\xEB\x012;/v2/{document.name=projects/*/knowledgeBases/*/documents/*}:\x08documentZS2G/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}:\x08documentZM2A/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}:\x08document\x12\xF8\x02\x0A\x0EReloadDocument\x121.google.cloud.dialogflow.v2.ReloadDocumentRequest\x1A\x1D.google.longrunning.Operation\"\x93\x02\xCAA&\x0A\x08Document\x12\x1AKnowledgeOperationMetadata\xDAA\x10name,content_uri\x82\xD3\xE4\x93\x02\xD0\x01\"9/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload:\x01*ZJ\"E/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload:\x01*ZD\"?/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload:\x01*\x12\x9F\x02\x0A\x0EExportDocument\x121.google.cloud.dialogflow.v2.ExportDocumentRequest\x1A\x1D.google.longrunning.Operation\"\xBA\x01\xCAA&\x0A\x08Document\x12\x1AKnowledgeOperationMetadata\x82\xD3\xE4\x93\x02\x8A\x01\"9/v2/{name=projects/*/knowledgeBases/*/documents/*}:export:\x01*ZJ\"E/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x93\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0DDocumentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php new file mode 100644 index 000000000000..40a9b766f375 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + "\x0A\x8E\x0C\x0A0google/cloud/dialogflow/v2/encryption_spec.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A#google/longrunning/operations.proto\"Z\x0A\x18GetEncryptionSpecRequest\x12>\x0A\x04name\x18\x01 \x01(\x09B0\xE0A\x02\xFAA*\x0A(dialogflow.googleapis.com/EncryptionSpec\"\xC3\x01\x0A\x0EEncryptionSpec\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x05\x12\x14\x0A\x07kms_key\x18\x02 \x01(\x09B\x03\xE0A\x02:\x87\x01\xEAA\x83\x01\x0A(dialogflow.googleapis.com/EncryptionSpec\x126projects/{project}/locations/{location}/encryptionSpec*\x0FencryptionSpecs2\x0EencryptionSpec\"k\x0A\x1FInitializeEncryptionSpecRequest\x12H\x0A\x0Fencryption_spec\x18\x01 \x01(\x0B2*.google.cloud.dialogflow.v2.EncryptionSpecB\x03\xE0A\x02\"\"\x0A InitializeEncryptionSpecResponse\"u\x0A InitializeEncryptionSpecMetadata\x12Q\x0A\x07request\x18\x04 \x01(\x0B2;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequestB\x03\xE0A\x032\xF5\x04\x0A\x15EncryptionSpecService\x12\xB6\x01\x0A\x11GetEncryptionSpec\x124.google.cloud.dialogflow.v2.GetEncryptionSpecRequest\x1A*.google.cloud.dialogflow.v2.EncryptionSpec\"?\xDAA\x04name\x82\xD3\xE4\x93\x022\x120/v2/{name=projects/*/locations/*/encryptionSpec}\x12\xA8\x02\x0A\x18InitializeEncryptionSpec\x12;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest\x1A\x1D.google.longrunning.Operation\"\xAF\x01\xCAAD\x0A InitializeEncryptionSpecResponse\x12 InitializeEncryptionSpecMetadata\xDAA\x0Fencryption_spec\x82\xD3\xE4\x93\x02P\"K/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x99\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x13EncryptionSpecProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php new file mode 100644 index 000000000000..f859a462e16a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + "\x0A\xD92\x0A,google/cloud/dialogflow/v2/entity_type.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\"\xC3\x05\x0A\x0AEntityType\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x12>\x0A\x04kind\x18\x03 \x01(\x0E2+.google.cloud.dialogflow.v2.EntityType.KindB\x03\xE0A\x02\x12Z\x0A\x13auto_expansion_mode\x18\x04 \x01(\x0E28.google.cloud.dialogflow.v2.EntityType.AutoExpansionModeB\x03\xE0A\x01\x12D\x0A\x08entities\x18\x06 \x03(\x0B2-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xE0A\x01\x12\$\x0A\x17enable_fuzzy_extraction\x18\x07 \x01(\x08B\x03\xE0A\x01\x1A3\x0A\x06Entity\x12\x12\x0A\x05value\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x15\x0A\x08synonyms\x18\x02 \x03(\x09B\x03\xE0A\x02\"J\x0A\x04Kind\x12\x14\x0A\x10KIND_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08KIND_MAP\x10\x01\x12\x0D\x0A\x09KIND_LIST\x10\x02\x12\x0F\x0A\x0BKIND_REGEXP\x10\x03\"Y\x0A\x11AutoExpansionMode\x12#\x0A\x1FAUTO_EXPANSION_MODE_UNSPECIFIED\x10\x00\x12\x1F\x0A\x1BAUTO_EXPANSION_MODE_DEFAULT\x10\x01:\xA7\x01\xEAA\xA3\x01\x0A\$dialogflow.googleapis.com/EntityType\x122projects/{project}/agent/entityTypes/{entity_type}\x12Gprojects/{project}/locations/{location}/agent/entityTypes/{entity_type}\"\xA3\x01\x0A\x16ListEntityTypesRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x12\$dialogflow.googleapis.com/EntityType\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09page_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x04 \x01(\x09B\x03\xE0A\x01\"p\x0A\x17ListEntityTypesResponse\x12<\x0A\x0Centity_types\x18\x01 \x03(\x0B2&.google.cloud.dialogflow.v2.EntityType\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"n\x0A\x14GetEntityTypeRequest\x12:\x0A\x04name\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x0A\$dialogflow.googleapis.com/EntityType\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x01\"\xB5\x01\x0A\x17CreateEntityTypeRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x12\$dialogflow.googleapis.com/EntityType\x12@\x0A\x0Bentity_type\x18\x02 \x01(\x0B2&.google.cloud.dialogflow.v2.EntityTypeB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\"\xAD\x01\x0A\x17UpdateEntityTypeRequest\x12@\x0A\x0Bentity_type\x18\x01 \x01(\x0B2&.google.cloud.dialogflow.v2.EntityTypeB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bupdate_mask\x18\x03 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"U\x0A\x17DeleteEntityTypeRequest\x12:\x0A\x04name\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x0A\$dialogflow.googleapis.com/EntityType\"\xB6\x02\x0A\x1DBatchUpdateEntityTypesRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x12\$dialogflow.googleapis.com/EntityType\x12\x1F\x0A\x15entity_type_batch_uri\x18\x02 \x01(\x09H\x00\x12O\x0A\x18entity_type_batch_inline\x18\x03 \x01(\x0B2+.google.cloud.dialogflow.v2.EntityTypeBatchH\x00\x12\x1A\x0A\x0Dlanguage_code\x18\x04 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bupdate_mask\x18\x05 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01B\x13\x0A\x11entity_type_batch\"^\x0A\x1EBatchUpdateEntityTypesResponse\x12<\x0A\x0Centity_types\x18\x01 \x03(\x0B2&.google.cloud.dialogflow.v2.EntityType\"}\x0A\x1DBatchDeleteEntityTypesRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x12\$dialogflow.googleapis.com/EntityType\x12\x1E\x0A\x11entity_type_names\x18\x02 \x03(\x09B\x03\xE0A\x02\"\xBC\x01\x0A\x1ABatchCreateEntitiesRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x0A\$dialogflow.googleapis.com/EntityType\x12D\x0A\x08entities\x18\x02 \x03(\x0B2-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\"\xF2\x01\x0A\x1ABatchUpdateEntitiesRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x0A\$dialogflow.googleapis.com/EntityType\x12D\x0A\x08entities\x18\x02 \x03(\x0B2-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bupdate_mask\x18\x04 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"\x92\x01\x0A\x1ABatchDeleteEntitiesRequest\x12<\x0A\x06parent\x18\x01 \x01(\x09B,\xE0A\x02\xFAA&\x0A\$dialogflow.googleapis.com/EntityType\x12\x1A\x0A\x0Dentity_values\x18\x02 \x03(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\"O\x0A\x0FEntityTypeBatch\x12<\x0A\x0Centity_types\x18\x01 \x03(\x0B2&.google.cloud.dialogflow.v2.EntityType2\xD6\x19\x0A\x0BEntityTypes\x12\x87\x02\x0A\x0FListEntityTypes\x122.google.cloud.dialogflow.v2.ListEntityTypesRequest\x1A3.google.cloud.dialogflow.v2.ListEntityTypesResponse\"\x8A\x01\xDAA\x06parent\xDAA\x14parent,language_code\x82\xD3\xE4\x93\x02d\x12)/v2/{parent=projects/*/agent}/entityTypesZ7\x125/v2/{parent=projects/*/locations/*/agent}/entityTypes\x12\xF2\x01\x0A\x0DGetEntityType\x120.google.cloud.dialogflow.v2.GetEntityTypeRequest\x1A&.google.cloud.dialogflow.v2.EntityType\"\x86\x01\xDAA\x04name\xDAA\x12name,language_code\x82\xD3\xE4\x93\x02d\x12)/v2/{name=projects/*/agent/entityTypes/*}Z7\x125/v2/{name=projects/*/locations/*/agent/entityTypes/*}\x12\xAE\x02\x0A\x10CreateEntityType\x123.google.cloud.dialogflow.v2.CreateEntityTypeRequest\x1A&.google.cloud.dialogflow.v2.EntityType\"\xBC\x01\xDAA\x12parent,entity_type\xDAA parent,entity_type,language_code\x82\xD3\xE4\x93\x02~\")/v2/{parent=projects/*/agent}/entityTypes:\x0Bentity_typeZD\"5/v2/{parent=projects/*/locations/*/agent}/entityTypes:\x0Bentity_type\x12\xB9\x02\x0A\x10UpdateEntityType\x123.google.cloud.dialogflow.v2.UpdateEntityTypeRequest\x1A&.google.cloud.dialogflow.v2.EntityType\"\xC7\x01\xDAA\x0Bentity_type\xDAA\x19entity_type,language_code\x82\xD3\xE4\x93\x02\x96\x0125/v2/{entity_type.name=projects/*/agent/entityTypes/*}:\x0Bentity_typeZP2A/v2/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}:\x0Bentity_type\x12\xD2\x01\x0A\x10DeleteEntityType\x123.google.cloud.dialogflow.v2.DeleteEntityTypeRequest\x1A\x16.google.protobuf.Empty\"q\xDAA\x04name\x82\xD3\xE4\x93\x02d*)/v2/{name=projects/*/agent/entityTypes/*}Z7*5/v2/{name=projects/*/locations/*/agent/entityTypes/*}\x12\xD4\x02\x0A\x16BatchUpdateEntityTypes\x129.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest\x1A\x1D.google.longrunning.Operation\"\xDF\x01\xCAAS\x0A9google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse\x12\x16google.protobuf.Struct\x82\xD3\xE4\x93\x02\x82\x01\"5/v2/{parent=projects/*/agent}/entityTypes:batchUpdate:\x01*ZF\"A/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate:\x01*\x12\xCB\x02\x0A\x16BatchDeleteEntityTypes\x129.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest\x1A\x1D.google.longrunning.Operation\"\xD6\x01\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xDAA\x18parent,entity_type_names\x82\xD3\xE4\x93\x02\x82\x01\"5/v2/{parent=projects/*/agent}/entityTypes:batchDelete:\x01*ZF\"A/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete:\x01*\x12\xF2\x02\x0A\x13BatchCreateEntities\x126.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest\x1A\x1D.google.longrunning.Operation\"\x83\x02\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xDAA\x0Fparent,entities\xDAA\x1Dparent,entities,language_code\x82\xD3\xE4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate:\x01*\x12\xF2\x02\x0A\x13BatchUpdateEntities\x126.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest\x1A\x1D.google.longrunning.Operation\"\x83\x02\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xDAA\x0Fparent,entities\xDAA\x1Dparent,entities,language_code\x82\xD3\xE4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate:\x01*\x12\xFC\x02\x0A\x13BatchDeleteEntities\x126.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest\x1A\x1D.google.longrunning.Operation\"\x8D\x02\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xDAA\x14parent,entity_values\xDAA\"parent,entity_values,language_code\x82\xD3\xE4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x95\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0FEntityTypeProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Environment.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Environment.php new file mode 100644 index 000000000000..917bc9772d38 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Environment.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + "\x0A\xB3\"\x0A,google/cloud/dialogflow/v2/environment.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A-google/cloud/dialogflow/v2/audio_config.proto\x1A,google/cloud/dialogflow/v2/fulfillment.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x84\x05\x0A\x0BEnvironment\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x01\x12@\x0A\x0Dagent_version\x18\x03 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Version\x12A\x0A\x05state\x18\x04 \x01(\x0E2-.google.cloud.dialogflow.v2.Environment.StateB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12V\x0A\x17text_to_speech_settings\x18\x07 \x01(\x0B20.google.cloud.dialogflow.v2.TextToSpeechSettingsB\x03\xE0A\x01\x12A\x0A\x0Bfulfillment\x18\x08 \x01(\x0B2'.google.cloud.dialogflow.v2.FulfillmentB\x03\xE0A\x01\"E\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07STOPPED\x10\x01\x12\x0B\x0A\x07LOADING\x10\x02\x12\x0B\x0A\x07RUNNING\x10\x03:\xAA\x01\xEAA\xA6\x01\x0A%dialogflow.googleapis.com/Environment\x123projects/{project}/agent/environments/{environment}\x12Hprojects/{project}/locations/{location}/agent/environments/{environment}\"\x9A\x03\x0A\x14TextToSpeechSettings\x12\"\x0A\x15enable_text_to_speech\x18\x01 \x01(\x08B\x03\xE0A\x01\x12S\x0A\x15output_audio_encoding\x18\x02 \x01(\x0E2/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xE0A\x02\x12\x1E\x0A\x11sample_rate_hertz\x18\x03 \x01(\x05B\x03\xE0A\x01\x12u\x0A\x19synthesize_speech_configs\x18\x04 \x03(\x0B2M.google.cloud.dialogflow.v2.TextToSpeechSettings.SynthesizeSpeechConfigsEntryB\x03\xE0A\x01\x1Ar\x0A\x1CSynthesizeSpeechConfigsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12A\x0A\x05value\x18\x02 \x01(\x0B22.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\x028\x01\"\x89\x01\x0A\x17ListEnvironmentsRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x12%dialogflow.googleapis.com/Environment\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"r\x0A\x18ListEnvironmentsResponse\x12=\x0A\x0Cenvironments\x18\x01 \x03(\x0B2'.google.cloud.dialogflow.v2.Environment\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"T\x0A\x15GetEnvironmentRequest\x12;\x0A\x04name\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Environment\"\xB9\x01\x0A\x18CreateEnvironmentRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x12%dialogflow.googleapis.com/Environment\x12A\x0A\x0Benvironment\x18\x02 \x01(\x0B2'.google.cloud.dialogflow.v2.EnvironmentB\x03\xE0A\x02\x12\x1B\x0A\x0Eenvironment_id\x18\x03 \x01(\x09B\x03\xE0A\x02\"\xC9\x01\x0A\x18UpdateEnvironmentRequest\x12A\x0A\x0Benvironment\x18\x01 \x01(\x0B2'.google.cloud.dialogflow.v2.EnvironmentB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x124\x0A'allow_load_to_draft_and_discard_changes\x18\x03 \x01(\x08B\x03\xE0A\x01\"W\x0A\x18DeleteEnvironmentRequest\x12;\x0A\x04name\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Environment\"\x8E\x01\x0A\x1CGetEnvironmentHistoryRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Environment\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"\xF9\x01\x0A\x12EnvironmentHistory\x12\x13\x0A\x06parent\x18\x01 \x01(\x09B\x03\xE0A\x03\x12J\x0A\x07entries\x18\x02 \x03(\x0B24.google.cloud.dialogflow.v2.EnvironmentHistory.EntryB\x03\xE0A\x03\x12\x1C\x0A\x0Fnext_page_token\x18\x03 \x01(\x09B\x03\xE0A\x03\x1Ad\x0A\x05Entry\x12\x15\x0A\x0Dagent_version\x18\x01 \x01(\x09\x12\x13\x0A\x0Bdescription\x18\x02 \x01(\x09\x12/\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp2\xCB\x0C\x0A\x0CEnvironments\x12\xF4\x01\x0A\x10ListEnvironments\x123.google.cloud.dialogflow.v2.ListEnvironmentsRequest\x1A4.google.cloud.dialogflow.v2.ListEnvironmentsResponse\"u\xDAA\x06parent\x82\xD3\xE4\x93\x02f\x12*/v2/{parent=projects/*/agent}/environmentsZ8\x126/v2/{parent=projects/*/locations/*/agent}/environments\x12\xDA\x01\x0A\x0EGetEnvironment\x121.google.cloud.dialogflow.v2.GetEnvironmentRequest\x1A'.google.cloud.dialogflow.v2.Environment\"l\x82\xD3\xE4\x93\x02f\x12*/v2/{name=projects/*/agent/environments/*}Z8\x126/v2/{name=projects/*/locations/*/agent/environments/*}\x12\xFC\x01\x0A\x11CreateEnvironment\x124.google.cloud.dialogflow.v2.CreateEnvironmentRequest\x1A'.google.cloud.dialogflow.v2.Environment\"\x87\x01\x82\xD3\xE4\x93\x02\x80\x01\"*/v2/{parent=projects/*/agent}/environments:\x0BenvironmentZE\"6/v2/{parent=projects/*/locations/*/agent}/environments:\x0Benvironment\x12\x94\x02\x0A\x11UpdateEnvironment\x124.google.cloud.dialogflow.v2.UpdateEnvironmentRequest\x1A'.google.cloud.dialogflow.v2.Environment\"\x9F\x01\x82\xD3\xE4\x93\x02\x98\x0126/v2/{environment.name=projects/*/agent/environments/*}:\x0BenvironmentZQ2B/v2/{environment.name=projects/*/locations/*/agent/environments/*}:\x0Benvironment\x12\xCF\x01\x0A\x11DeleteEnvironment\x124.google.cloud.dialogflow.v2.DeleteEnvironmentRequest\x1A\x16.google.protobuf.Empty\"l\x82\xD3\xE4\x93\x02f**/v2/{name=projects/*/agent/environments/*}Z8*6/v2/{name=projects/*/locations/*/agent/environments/*}\x12\x84\x02\x0A\x15GetEnvironmentHistory\x128.google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest\x1A..google.cloud.dialogflow.v2.EnvironmentHistory\"\x80\x01\x82\xD3\xE4\x93\x02z\x124/v2/{parent=projects/*/agent/environments/*}/historyZB\x12@/v2/{parent=projects/*/locations/*/agent/environments/*}/history\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x10EnvironmentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Fulfillment.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Fulfillment.php new file mode 100644 index 000000000000..9e8688979c8e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Fulfillment.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + "\x0A\x8E\x10\x0A,google/cloud/dialogflow/v2/fulfillment.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A google/protobuf/field_mask.proto\"\xA9\x06\x0A\x0BFulfillment\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x01\x12X\x0A\x13generic_web_service\x18\x03 \x01(\x0B29.google.cloud.dialogflow.v2.Fulfillment.GenericWebServiceH\x00\x12\x14\x0A\x07enabled\x18\x04 \x01(\x08B\x03\xE0A\x01\x12F\x0A\x08features\x18\x05 \x03(\x0B2/.google.cloud.dialogflow.v2.Fulfillment.FeatureB\x03\xE0A\x01\x1A\x99\x02\x0A\x11GenericWebService\x12\x10\x0A\x03uri\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x15\x0A\x08username\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08password\x18\x03 \x01(\x09B\x03\xE0A\x01\x12k\x0A\x0Frequest_headers\x18\x04 \x03(\x0B2M.google.cloud.dialogflow.v2.Fulfillment.GenericWebService.RequestHeadersEntryB\x03\xE0A\x01\x12 \x0A\x11is_cloud_function\x18\x05 \x01(\x08B\x05\x18\x01\xE0A\x01\x1A5\x0A\x13RequestHeadersEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\x1Az\x0A\x07Feature\x12B\x0A\x04type\x18\x01 \x01(\x0E24.google.cloud.dialogflow.v2.Fulfillment.Feature.Type\"+\x0A\x04Type\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09SMALLTALK\x10\x01:\x8C\x01\xEAA\x88\x01\x0A%dialogflow.googleapis.com/Fulfillment\x12\$projects/{project}/agent/fulfillment\x129projects/{project}/locations/{location}/agent/fulfillmentB\x0D\x0A\x0Bfulfillment\"T\x0A\x15GetFulfillmentRequest\x12;\x0A\x04name\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Fulfillment\"\x93\x01\x0A\x18UpdateFulfillmentRequest\x12A\x0A\x0Bfulfillment\x18\x01 \x01(\x0B2'.google.cloud.dialogflow.v2.FulfillmentB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x022\x91\x05\x0A\x0CFulfillments\x12\xDB\x01\x0A\x0EGetFulfillment\x121.google.cloud.dialogflow.v2.GetFulfillmentRequest\x1A'.google.cloud.dialogflow.v2.Fulfillment\"m\xDAA\x04name\x82\xD3\xE4\x93\x02`\x12'/v2/{name=projects/*/agent/fulfillment}Z5\x123/v2/{name=projects/*/locations/*/agent/fulfillment}\x12\xA8\x02\x0A\x11UpdateFulfillment\x124.google.cloud.dialogflow.v2.UpdateFulfillmentRequest\x1A'.google.cloud.dialogflow.v2.Fulfillment\"\xB3\x01\xDAA\x17fulfillment,update_mask\x82\xD3\xE4\x93\x02\x92\x0123/v2/{fulfillment.name=projects/*/agent/fulfillment}:\x0BfulfillmentZN2?/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}:\x0Bfulfillment\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x10FulfillmentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Gcs.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Gcs.php new file mode 100644 index 000000000000..d6660fcf50cc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Gcs.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\x9B\x02\x0A\$google/cloud/dialogflow/v2/gcs.proto\x12\x1Agoogle.cloud.dialogflow.v2\"\x1F\x0A\x0AGcsSources\x12\x11\x0A\x04uris\x18\x02 \x03(\x09B\x03\xE0A\x02\"\x1D\x0A\x0EGcsDestination\x12\x0B\x0A\x03uri\x18\x01 \x01(\x09B\x8E\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x08GcsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php new file mode 100644 index 000000000000..9be66b1b893c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + "\x0A\xB0B\x0A*google/cloud/dialogflow/v2/generator.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A;google/cloud/dialogflow/v2/agent_coaching_instruction.proto\x1A(google/cloud/dialogflow/v2/ces_app.proto\x1A)google/cloud/dialogflow/v2/ces_tool.proto\x1A*google/cloud/dialogflow/v2/tool_call.proto\x1A(google/cloud/dialogflow/v2/toolset.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xB7\x01\x0A\x16CreateGeneratorRequest\x12C\x0A\x06parent\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x0A+cloudresourcemanager.googleapis.com/Project\x12=\x0A\x09generator\x18\x02 \x01(\x0B2%.google.cloud.dialogflow.v2.GeneratorB\x03\xE0A\x02\x12\x19\x0A\x0Cgenerator_id\x18\x03 \x01(\x09B\x03\xE0A\x01\"P\x0A\x13GetGeneratorRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#dialogflow.googleapis.com/Generator\"\x8D\x01\x0A\x15ListGeneratorsRequest\x12C\x0A\x06parent\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x0A+cloudresourcemanager.googleapis.com/Project\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"l\x0A\x16ListGeneratorsResponse\x129\x0A\x0Agenerators\x18\x01 \x03(\x0B2%.google.cloud.dialogflow.v2.Generator\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"S\x0A\x16DeleteGeneratorRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#dialogflow.googleapis.com/Generator\"\x8D\x01\x0A\x16UpdateGeneratorRequest\x12=\x0A\x09generator\x18\x01 \x01(\x0B2%.google.cloud.dialogflow.v2.GeneratorB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"\x87\x02\x0A\x0CMessageEntry\x12@\x0A\x04role\x18\x01 \x01(\x0E2-.google.cloud.dialogflow.v2.MessageEntry.RoleB\x03\xE0A\x01\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x01\"P\x0A\x04Role\x12\x14\x0A\x10ROLE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BHUMAN_AGENT\x10\x01\x12\x13\x0A\x0FAUTOMATED_AGENT\x10\x02\x12\x0C\x0A\x08END_USER\x10\x03\"]\x0A\x13ConversationContext\x12F\x0A\x0Fmessage_entries\x18\x01 \x03(\x0B2(.google.cloud.dialogflow.v2.MessageEntryB\x03\xE0A\x01\"q\x0A\x18SummarizationSectionList\x12U\x0A\x16summarization_sections\x18\x01 \x03(\x0B20.google.cloud.dialogflow.v2.SummarizationSectionB\x03\xE0A\x01\"\xA0\x03\x0A\x0EFewShotExample\x12R\x0A\x14conversation_context\x18\x03 \x01(\x0B2/.google.cloud.dialogflow.v2.ConversationContextB\x03\xE0A\x01\x12R\x0A\x0Aextra_info\x18\x04 \x03(\x0B29.google.cloud.dialogflow.v2.FewShotExample.ExtraInfoEntryB\x03\xE0A\x01\x12Z\x0A\x1Asummarization_section_list\x18\x06 \x01(\x0B24.google.cloud.dialogflow.v2.SummarizationSectionListH\x00\x12D\x0A\x06output\x18\x07 \x01(\x0B2/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xE0A\x02\x1A0\x0A\x0EExtraInfoEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01B\x12\x0A\x10instruction_list\"\xC4\x01\x0A\x12InferenceParameter\x12#\x0A\x11max_output_tokens\x18\x01 \x01(\x05B\x03\xE0A\x01H\x00\x88\x01\x01\x12\x1D\x0A\x0Btemperature\x18\x02 \x01(\x01B\x03\xE0A\x01H\x01\x88\x01\x01\x12\x17\x0A\x05top_k\x18\x03 \x01(\x05B\x03\xE0A\x01H\x02\x88\x01\x01\x12\x17\x0A\x05top_p\x18\x04 \x01(\x01B\x03\xE0A\x01H\x03\x88\x01\x01B\x14\x0A\x12_max_output_tokensB\x0E\x0A\x0C_temperatureB\x08\x0A\x06_top_kB\x08\x0A\x06_top_p\"\xC3\x01\x0A\x14AgentCoachingContext\x12!\x0A\x14overarching_guidance\x18\x07 \x01(\x09B\x03\xE0A\x01\x12O\x0A\x0Cinstructions\x18\x01 \x03(\x0B24.google.cloud.dialogflow.v2.AgentCoachingInstructionB\x03\xE0A\x01\x12\x14\x0A\x07version\x18\x02 \x01(\x09B\x03\xE0A\x01\x12!\x0A\x14output_language_code\x18\x09 \x01(\x09B\x03\xE0A\x01\"\xDC\x02\x0A\x14SummarizationSection\x12\x10\x0A\x03key\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x17\x0A\x0Adefinition\x18\x02 \x01(\x09B\x03\xE0A\x01\x12H\x0A\x04type\x18\x03 \x01(\x0E25.google.cloud.dialogflow.v2.SummarizationSection.TypeB\x03\xE0A\x01\"\xCE\x01\x0A\x04Type\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09SITUATION\x10\x01\x12\x0A\x0A\x06ACTION\x10\x02\x12\x0E\x0A\x0ARESOLUTION\x10\x03\x12\x1B\x0A\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\x0A\x15CUSTOMER_SATISFACTION\x10\x05\x12\x0C\x0A\x08ENTITIES\x10\x06\x12\x14\x0A\x10CUSTOMER_DEFINED\x10\x07\x12\x15\x0A\x11SITUATION_CONCISE\x10\x09\x12\x12\x0A\x0EACTION_CONCISE\x10\x0A\"\xF2\x01\x0A\x14SummarizationContext\x12U\x0A\x16summarization_sections\x18\x01 \x03(\x0B20.google.cloud.dialogflow.v2.SummarizationSectionB\x03\xE0A\x01\x12J\x0A\x11few_shot_examples\x18\x02 \x03(\x0B2*.google.cloud.dialogflow.v2.FewShotExampleB\x03\xE0A\x01\x12\x14\x0A\x07version\x18\x03 \x01(\x09B\x03\xE0A\x01\x12!\x0A\x14output_language_code\x18\x06 \x01(\x09B\x03\xE0A\x01\"\$\x0A\x0FFreeFormContext\x12\x11\x0A\x04text\x18\x01 \x01(\x09B\x03\xE0A\x01\"\xD5\x08\x0A\x09Generator\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x08\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x01\x12H\x0A\x11free_form_context\x18\x0B \x01(\x0B2+.google.cloud.dialogflow.v2.FreeFormContextH\x00\x12R\x0A\x16agent_coaching_context\x18\x0C \x01(\x0B20.google.cloud.dialogflow.v2.AgentCoachingContextH\x00\x12Q\x0A\x15summarization_context\x18\x0D \x01(\x0B20.google.cloud.dialogflow.v2.SummarizationContextH\x00\x12P\x0A\x13inference_parameter\x18\x04 \x01(\x0B2..google.cloud.dialogflow.v2.InferenceParameterB\x03\xE0A\x01\x12D\x0A\x0Dtrigger_event\x18\x05 \x01(\x0E2(.google.cloud.dialogflow.v2.TriggerEventB\x03\xE0A\x01\x12\x1E\x0A\x0Fpublished_model\x18\x0F \x01(\x09B\x03\xE0A\x01H\x01\x124\x0A\x0Bcreate_time\x18\x08 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x09 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x125\x0A\x05tools\x18\x0E \x03(\x09B&\xE0A\x01\xFAA \x0A\x1Edialogflow.googleapis.com/Tool\x12]\x0A\x1Asuggestion_deduping_config\x18\x17 \x01(\x0B24.google.cloud.dialogflow.v2.SuggestionDedupingConfigB\x03\xE0A\x01\x12C\x0A\x0Dtoolset_tools\x18\x1B \x03(\x0B2'.google.cloud.dialogflow.v2.ToolsetToolB\x03\xE0A\x01\x12D\x0A\x0Eces_tool_specs\x18\x1C \x03(\x0B2'.google.cloud.dialogflow.v2.CesToolSpecB\x03\xE0A\x01\x12B\x0A\x0Dces_app_specs\x18\x1D \x03(\x0B2&.google.cloud.dialogflow.v2.CesAppSpecB\x03\xE0A\x01:\x7F\xEAA|\x0A#dialogflow.googleapis.com/Generator\x12>projects/{project}/locations/{location}/generators/{generator}*\x0Agenerators2\x09generatorB\x09\x0A\x07contextB\x12\x0A\x10foundation_model\"+\x0A\x12FreeFormSuggestion\x12\x15\x0A\x08response\x18\x01 \x01(\x09B\x03\xE0A\x02\"\xAE\x01\x0A\x11SummarySuggestion\x12[\x0A\x10summary_sections\x18\x01 \x03(\x0B2<.google.cloud.dialogflow.v2.SummarySuggestion.SummarySectionB\x03\xE0A\x02\x1A<\x0A\x0ESummarySection\x12\x14\x0A\x07section\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x14\x0A\x07summary\x18\x02 \x01(\x09B\x03\xE0A\x02\"\xC0\x09\x0A\x17AgentCoachingSuggestion\x12Z\x0A\x17applicable_instructions\x18\x01 \x03(\x0B24.google.cloud.dialogflow.v2.AgentCoachingInstructionB\x03\xE0A\x01\x12p\x0A\x18agent_action_suggestions\x18\x02 \x03(\x0B2I.google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestionB\x03\xE0A\x01\x12a\x0A\x10sample_responses\x18\x03 \x03(\x0B2B.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponseB\x03\xE0A\x01\x1A+\x0A\x07Sources\x12 \x0A\x13instruction_indexes\x18\x02 \x03(\x05B\x03\xE0A\x03\x1A\xDE\x02\x0A\x14DuplicateCheckResult\x12\x80\x01\x0A\x15duplicate_suggestions\x18\x01 \x03(\x0B2\\.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestionB\x03\xE0A\x03\x1A\xC2\x01\x0A\x13DuplicateSuggestion\x12\x1A\x0A\x0Danswer_record\x18\x01 \x01(\x09B\x03\xE0A\x03\x12Q\x0A\x07sources\x18\x02 \x01(\x0B2;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xE0A\x03\x12\x1D\x0A\x10suggestion_index\x18\x03 \x01(\x05B\x03\xE0A\x03\x12\x1D\x0A\x10similarity_score\x18\x04 \x01(\x02B\x03\xE0A\x03\x1A\xF4\x01\x0A\x15AgentActionSuggestion\x12\x19\x0A\x0Cagent_action\x18\x01 \x01(\x09B\x03\xE0A\x01\x12Q\x0A\x07sources\x18\x02 \x01(\x0B2;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xE0A\x03\x12m\x0A\x16duplicate_check_result\x18\x03 \x01(\x0B2H.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResultB\x03\xE0A\x03\x1A\xEE\x01\x0A\x0ESampleResponse\x12\x1A\x0A\x0Dresponse_text\x18\x01 \x01(\x09B\x03\xE0A\x01\x12Q\x0A\x07sources\x18\x02 \x01(\x0B2;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xE0A\x03\x12m\x0A\x16duplicate_check_result\x18\x03 \x01(\x0B2H.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResultB\x03\xE0A\x03\"\x9E\x04\x0A\x13GeneratorSuggestion\x12S\x0A\x14free_form_suggestion\x18\x01 \x01(\x0B2..google.cloud.dialogflow.v2.FreeFormSuggestionB\x03\xE0A\x01H\x00\x12P\x0A\x12summary_suggestion\x18\x02 \x01(\x0B2-.google.cloud.dialogflow.v2.SummarySuggestionB\x03\xE0A\x01H\x00\x12]\x0A\x19agent_coaching_suggestion\x18\x03 \x01(\x0B23.google.cloud.dialogflow.v2.AgentCoachingSuggestionB\x03\xE0A\x01H\x00\x12Y\x0A\x0Etool_call_info\x18\x09 \x03(\x0B2<.google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfoB\x03\xE0A\x01\x1A\x97\x01\x0A\x0CToolCallInfo\x12<\x0A\x09tool_call\x18\x01 \x01(\x0B2\$.google.cloud.dialogflow.v2.ToolCallB\x03\xE0A\x02\x12I\x0A\x10tool_call_result\x18\x02 \x01(\x0B2*.google.cloud.dialogflow.v2.ToolCallResultB\x03\xE0A\x02B\x0C\x0A\x0Asuggestion\"[\x0A\x18SuggestionDedupingConfig\x12\x1C\x0A\x0Fenable_deduping\x18\x01 \x01(\x08B\x03\xE0A\x01\x12!\x0A\x14similarity_threshold\x18\x02 \x01(\x02B\x03\xE0A\x01\"\xB8\x04\x0A\x0BRaiSettings\x12W\x0A\x14rai_category_configs\x18\x01 \x03(\x0B29.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig\x1A\xCF\x03\x0A\x11RaiCategoryConfig\x12\\\x0A\x08category\x18\x01 \x01(\x0E2E.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategoryB\x03\xE0A\x01\x12j\x0A\x11sensitivity_level\x18\x02 \x01(\x0E2J.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevelB\x03\xE0A\x01\"z\x0A\x0BRaiCategory\x12\x1C\x0A\x18RAI_CATEGORY_UNSPECIFIED\x10\x00\x12\x15\x0A\x11DANGEROUS_CONTENT\x10\x01\x12\x15\x0A\x11SEXUALLY_EXPLICIT\x10\x02\x12\x0E\x0A\x0AHARASSMENT\x10\x03\x12\x0F\x0A\x0BHATE_SPEECH\x10\x04\"t\x0A\x10SensitivityLevel\x12!\x0A\x1DSENSITIVITY_LEVEL_UNSPECIFIED\x10\x00\x12\x0E\x0A\x0ABLOCK_MOST\x10\x01\x12\x0E\x0A\x0ABLOCK_SOME\x10\x02\x12\x0D\x0A\x09BLOCK_FEW\x10\x03\x12\x0E\x0A\x0ABLOCK_NONE\x10\x04*}\x0A\x0CTriggerEvent\x12\x1D\x0A\x19TRIGGER_EVENT_UNSPECIFIED\x10\x00\x12\x14\x0A\x10END_OF_UTTERANCE\x10\x01\x12\x0F\x0A\x0BMANUAL_CALL\x10\x02\x12\x14\x0A\x10CUSTOMER_MESSAGE\x10\x03\x12\x11\x0A\x0DAGENT_MESSAGE\x10\x042\x86\x09\x0A\x0AGenerators\x12\x81\x02\x0A\x0FCreateGenerator\x122.google.cloud.dialogflow.v2.CreateGeneratorRequest\x1A%.google.cloud.dialogflow.v2.Generator\"\x92\x01\xDAA\x1Dparent,generator,generator_id\x82\xD3\xE4\x93\x02l\"./v2/{parent=projects/*/locations/*}/generators:\x09generatorZ/\"\"/v2/{parent=projects/*}/generators:\x09generator\x12\xA5\x01\x0A\x0CGetGenerator\x12/.google.cloud.dialogflow.v2.GetGeneratorRequest\x1A%.google.cloud.dialogflow.v2.Generator\"=\xDAA\x04name\x82\xD3\xE4\x93\x020\x12./v2/{name=projects/*/locations/*/generators/*}\x12\xDE\x01\x0A\x0EListGenerators\x121.google.cloud.dialogflow.v2.ListGeneratorsRequest\x1A2.google.cloud.dialogflow.v2.ListGeneratorsResponse\"e\xDAA\x06parent\x82\xD3\xE4\x93\x02V\x12./v2/{parent=projects/*/locations/*}/generatorsZ\$\x12\"/v2/{parent=projects/*}/generators\x12\x9C\x01\x0A\x0FDeleteGenerator\x122.google.cloud.dialogflow.v2.DeleteGeneratorRequest\x1A\x16.google.protobuf.Empty\"=\xDAA\x04name\x82\xD3\xE4\x93\x020*./v2/{name=projects/*/locations/*/generators/*}\x12\xD1\x01\x0A\x0FUpdateGenerator\x122.google.cloud.dialogflow.v2.UpdateGeneratorRequest\x1A%.google.cloud.dialogflow.v2.Generator\"c\xDAA\x15generator,update_mask\x82\xD3\xE4\x93\x02E28/v2/{generator.name=projects/*/locations/*/generators/*}:\x09generator\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x91\x02\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0EGeneratorProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAAz\x0A%discoveryengine.googleapis.com/Engine\x12Qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php new file mode 100644 index 000000000000..b1e41053cf16 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + "\x0A\xC5>\x0A5google/cloud/dialogflow/v2/generator_evaluation.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A*google/cloud/dialogflow/v2/generator.proto\x1A+google/cloud/dialogflow/v2/operations.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x17google/rpc/status.proto\"\xBD\x01\x0A CreateGeneratorEvaluationRequest\x12E\x0A\x06parent\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x12-dialogflow.googleapis.com/GeneratorEvaluation\x12R\x0A\x14generator_evaluation\x18\x02 \x01(\x0B2/.google.cloud.dialogflow.v2.GeneratorEvaluationB\x03\xE0A\x02\"d\x0A\x1DGetGeneratorEvaluationRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/GeneratorEvaluation\"\x99\x01\x0A\x1FListGeneratorEvaluationsRequest\x12E\x0A\x06parent\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x12-dialogflow.googleapis.com/GeneratorEvaluation\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"\x8B\x01\x0A ListGeneratorEvaluationsResponse\x12N\x0A\x15generator_evaluations\x18\x01 \x03(\x0B2/.google.cloud.dialogflow.v2.GeneratorEvaluation\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"g\x0A DeleteGeneratorEvaluationRequest\x12C\x0A\x04name\x18\x01 \x01(\x09B5\xE0A\x02\xFAA/\x0A-dialogflow.googleapis.com/GeneratorEvaluation\"\xB7\x06\x0A\x13GeneratorEvaluation\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x08\xE0A\x03\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x01\x12_\x0A\x1Bgenerator_evaluation_config\x18\x03 \x01(\x0B25.google.cloud.dialogflow.v2.GeneratorEvaluationConfigB\x03\xE0A\x02\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x126\x0A\x0Dcomplete_time\x18\x08 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12E\x0A\x11initial_generator\x18\x05 \x01(\x0B2%.google.cloud.dialogflow.v2.GeneratorB\x03\xE0A\x02\x12`\x0A\x15summarization_metrics\x18\x06 \x01(\x0B2:.google.cloud.dialogflow.v2.SummarizationEvaluationMetricsB\x03\xE0A\x03H\x00\x12L\x0A\x11evaluation_status\x18\x0A \x01(\x0B2,.google.cloud.dialogflow.v2.EvaluationStatusB\x03\xE0A\x03\x12\x1F\x0A\x0Dsatisfies_pzs\x18\x0B \x01(\x08B\x03\xE0A\x03H\x01\x88\x01\x01\x12\x1F\x0A\x0Dsatisfies_pzi\x18\x0C \x01(\x08B\x03\xE0A\x03H\x02\x88\x01\x01:\xB7\x01\xEAA\xB3\x01\x0A-dialogflow.googleapis.com/GeneratorEvaluation\x12Wprojects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}*\x14generatorEvaluations2\x13generatorEvaluationB\x09\x0A\x07metricsB\x10\x0A\x0E_satisfies_pzsB\x10\x0A\x0E_satisfies_pzi\"\xA2\x17\x0A\x1ESummarizationEvaluationMetrics\x12\x87\x01\x0A summarization_evaluation_results\x18\x04 \x03(\x0B2X.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResultB\x03\xE0A\x03\x128\x0A+summarization_evaluation_merged_results_uri\x18\x05 \x01(\x09B\x03\xE0A\x03\x12n\x0A\x0Foverall_metrics\x18\x06 \x03(\x0B2P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetricB\x03\xE0A\x03\x12l\x0A\x16overall_section_tokens\x18\x07 \x03(\x0B2G.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionTokenB\x03\xE0A\x03\x12p\x0A\x14conversation_details\x18\x08 \x03(\x0B2M.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetailB\x03\xE0A\x03\x1A{\x0A\x15AccuracyDecomposition\x12\x12\x0A\x05point\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x1F\x0A\x12accuracy_reasoning\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x1D\x0A\x0Bis_accurate\x18\x03 \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01B\x0E\x0A\x0C_is_accurate\x1Al\x0A\x16AdherenceDecomposition\x12\x12\x0A\x05point\x18\x01 \x01(\x09B\x03\xE0A\x03\x12 \x0A\x13adherence_reasoning\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bis_adherent\x18\x03 \x01(\x08B\x03\xE0A\x03:\x02\x18\x01\x1Aq\x0A\x0FAdherenceRubric\x12\x15\x0A\x08question\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x16\x0A\x09reasoning\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x1E\x0A\x0Cis_addressed\x18\x03 \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01B\x0F\x0A\x0D_is_addressed\x1A\\\x0A\x12CompletenessRubric\x12\x15\x0A\x08question\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x1E\x0A\x0Cis_addressed\x18\x02 \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01B\x0F\x0A\x0D_is_addressed\x1A\x8E\x02\x0A\x0DDecomposition\x12r\x0A\x16accuracy_decomposition\x18\x01 \x01(\x0B2P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecompositionH\x00\x12t\x0A\x17adherence_decomposition\x18\x02 \x01(\x0B2Q.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecompositionH\x00:\x02\x18\x01B\x0F\x0A\x0Ddecomposition\x1A\xE6\x02\x0A\x10EvaluationResult\x12r\x0A\x16accuracy_decomposition\x18\x01 \x01(\x0B2P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecompositionH\x00\x12f\x0A\x10adherence_rubric\x18\x02 \x01(\x0B2J.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubricH\x00\x12l\x0A\x13completeness_rubric\x18\x03 \x01(\x0B2M.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubricH\x00B\x08\x0A\x06result\x1A\xEE\x02\x0A\x1DSummarizationEvaluationResult\x12\x19\x0A\x0Asession_id\x18\x01 \x01(\x09B\x05\x18\x01\xE0A\x03\x12\x13\x0A\x06metric\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07section\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x12\x0A\x05score\x18\x04 \x01(\x02B\x03\xE0A\x03\x12\x1C\x0A\x0Fsection_summary\x18\x06 \x01(\x09B\x03\xE0A\x03\x12g\x0A\x0Edecompositions\x18\x07 \x03(\x0B2H.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.DecompositionB\x05\x18\x01\xE0A\x03\x12l\x0A\x12evaluation_results\x18\x08 \x03(\x0B2K.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResultB\x03\xE0A\x03\x1A,\x0A\x15OverallScoresByMetric\x12\x13\x0A\x06metric\x18\x01 \x01(\x09B\x03\xE0A\x03\x1AS\x0A\x0CSectionToken\x12\x14\x0A\x07section\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x1D\x0A\x0Btoken_count\x18\x02 \x01(\x03B\x03\xE0A\x03H\x00\x88\x01\x01B\x0E\x0A\x0C_token_count\x1A\xC1\x06\x0A\x12ConversationDetail\x12F\x0A\x0Fmessage_entries\x18\x01 \x03(\x0B2(.google.cloud.dialogflow.v2.MessageEntryB\x03\xE0A\x03\x12[\x0A\x10summary_sections\x18\x04 \x03(\x0B2<.google.cloud.dialogflow.v2.SummarySuggestion.SummarySectionB\x03\xE0A\x03\x12w\x0A\x0Emetric_details\x18\x02 \x03(\x0B2Z.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetailB\x03\xE0A\x03\x12d\x0A\x0Esection_tokens\x18\x03 \x03(\x0B2G.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionTokenB\x03\xE0A\x03\x1A\xA6\x03\x0A\x0CMetricDetail\x12\x13\x0A\x06metric\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x17\x0A\x05score\x18\x02 \x01(\x02B\x03\xE0A\x03H\x00\x88\x01\x01\x12\x86\x01\x0A\x0Fsection_details\x18\x04 \x03(\x0B2h.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetailB\x03\xE0A\x03\x1A\xD4\x01\x0A\x0DSectionDetail\x12\x14\x0A\x07section\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x17\x0A\x05score\x18\x02 \x01(\x02B\x03\xE0A\x03H\x00\x88\x01\x01\x12\x1C\x0A\x0Fsection_summary\x18\x04 \x01(\x09B\x03\xE0A\x03\x12l\x0A\x12evaluation_results\x18\x05 \x03(\x0B2K.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResultB\x03\xE0A\x03B\x08\x0A\x06_scoreB\x08\x0A\x06_score\"\xBF\x0D\x0A\x19GeneratorEvaluationConfig\x12e\x0A\x11input_data_config\x18\x01 \x01(\x0B2E.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfigB\x03\xE0A\x02\x12#\x0A\x16output_gcs_bucket_path\x18\x02 \x01(\x09B\x03\xE0A\x02\x12i\x0A\x14summarization_config\x18\x03 \x01(\x0B2I.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfigH\x00\x1A\x84\x01\x0A\x1AAgentAssistInputDataConfig\x123\x0A\x0Astart_time\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x02\x121\x0A\x08end_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x02\x1A.\x0A\x16DatasetInputDataConfig\x12\x14\x0A\x07dataset\x18\x01 \x01(\x09B\x03\xE0A\x02\x1A\xD2\x06\x0A\x0FInputDataConfig\x12p\x0A\x16input_data_source_type\x18\x01 \x01(\x0E2I.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceTypeB\x05\x18\x01\xE0A\x02\x125\x0A\x0Astart_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x05\x18\x01\xE0A\x01\x123\x0A\x08end_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x05\x18\x01\xE0A\x01\x12\x18\x0A\x0Bsample_size\x18\x04 \x01(\x05B\x03\xE0A\x01\x12,\x0A\x1Dis_summary_generation_allowed\x18\x05 \x01(\x08B\x05\x18\x01\xE0A\x01\x12\x85\x01\x0A\x19summary_generation_option\x18\x08 \x01(\x0E2].google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOptionB\x03\xE0A\x01\x12z\x0A\x1Eagent_assist_input_data_config\x18\x06 \x01(\x0B2P.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfigH\x00\x12q\x0A\x19dataset_input_data_config\x18\x07 \x01(\x0B2L.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfigH\x00\"\x87\x01\x0A\x17SummaryGenerationOption\x12)\x0A%SUMMARY_GENERATION_OPTION_UNSPECIFIED\x10\x00\x12\x13\x0A\x0FALWAYS_GENERATE\x10\x01\x12\x17\x0A\x13GENERATE_IF_MISSING\x10\x02\x12\x13\x0A\x0FDO_NOT_GENERATE\x10\x03B\x18\x0A\x16source_specific_config\x1A\x86\x02\x0A\x13SummarizationConfig\x12)\x0A\x1Aenable_accuracy_evaluation\x18\x01 \x01(\x08B\x05\x18\x01\xE0A\x01\x12*\x0A\x1Baccuracy_evaluation_version\x18\x02 \x01(\x09B\x05\x18\x01\xE0A\x01\x12-\x0A\x1Eenable_completeness_evaluation\x18\x03 \x01(\x08B\x05\x18\x01\xE0A\x01\x12.\x0A\x1Fcompleteness_evaluation_version\x18\x04 \x01(\x09B\x05\x18\x01\xE0A\x01\x12#\x0A\x11evaluator_version\x18\x05 \x01(\x09B\x03\xE0A\x01H\x00\x88\x01\x01B\x14\x0A\x12_evaluator_version\"y\x0A\x13InputDataSourceType\x12&\x0A\"INPUT_DATA_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1AAGENT_ASSIST_CONVERSATIONS\x10\x01\x12\x1A\x0A\x16INSIGHTS_CONVERSATIONS\x10\x02B\x1B\x0A\x19evaluation_feature_config\"e\x0A\x10EvaluationStatus\x12\x16\x0A\x04done\x18\x01 \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01\x120\x0A\x0Fpipeline_status\x18\x02 \x01(\x0B2\x12.google.rpc.StatusB\x03\xE0A\x03B\x07\x0A\x05_done2\xDB\x08\x0A\x14GeneratorEvaluations\x12\xCC\x02\x0A\x19CreateGeneratorEvaluation\x12<.google.cloud.dialogflow.v2.CreateGeneratorEvaluationRequest\x1A\x1D.google.longrunning.Operation\"\xD1\x01\xCAAV\x0A\x13GeneratorEvaluation\x12?google.cloud.dialogflow.v2.GeneratorEvaluationOperationMetadata\xDAA\x1Bparent,generator_evaluation\x82\xD3\xE4\x93\x02T\"\x12\x12*cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php new file mode 100644 index 000000000000..389a2cd6e66a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\x9A\x03\x0Acloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Intent.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Intent.php new file mode 100644 index 000000000000..311d035f1f55 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Intent.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + "\x0A\x8E[\x0A'google/cloud/dialogflow/v2/intent.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A(google/cloud/dialogflow/v2/context.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\"\xDC8\x0A\x06Intent\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x12K\x0A\x0Dwebhook_state\x18\x06 \x01(\x0E2/.google.cloud.dialogflow.v2.Intent.WebhookStateB\x03\xE0A\x01\x12\x15\x0A\x08priority\x18\x03 \x01(\x05B\x03\xE0A\x01\x12\x18\x0A\x0Bis_fallback\x18\x04 \x01(\x08B\x03\xE0A\x01\x12\x18\x0A\x0Bml_disabled\x18\x13 \x01(\x08B\x03\xE0A\x01\x12\x1F\x0A\x12live_agent_handoff\x18\x14 \x01(\x08B\x03\xE0A\x01\x12\x1C\x0A\x0Fend_interaction\x18\x15 \x01(\x08B\x03\xE0A\x01\x12 \x0A\x13input_context_names\x18\x07 \x03(\x09B\x03\xE0A\x01\x12\x13\x0A\x06events\x18\x08 \x03(\x09B\x03\xE0A\x01\x12P\x0A\x10training_phrases\x18\x09 \x03(\x0B21.google.cloud.dialogflow.v2.Intent.TrainingPhraseB\x03\xE0A\x01\x12\x13\x0A\x06action\x18\x0A \x01(\x09B\x03\xE0A\x01\x12A\x0A\x0Foutput_contexts\x18\x0B \x03(\x0B2#.google.cloud.dialogflow.v2.ContextB\x03\xE0A\x01\x12\x1B\x0A\x0Ereset_contexts\x18\x0C \x01(\x08B\x03\xE0A\x01\x12E\x0A\x0Aparameters\x18\x0D \x03(\x0B2,.google.cloud.dialogflow.v2.Intent.ParameterB\x03\xE0A\x01\x12A\x0A\x08messages\x18\x0E \x03(\x0B2*.google.cloud.dialogflow.v2.Intent.MessageB\x03\xE0A\x01\x12\\\x0A\x1Adefault_response_platforms\x18\x0F \x03(\x0E23.google.cloud.dialogflow.v2.Intent.Message.PlatformB\x03\xE0A\x01\x12&\x0A\x19root_followup_intent_name\x18\x10 \x01(\x09B\x03\xE0A\x03\x12#\x0A\x1Bparent_followup_intent_name\x18\x11 \x01(\x09\x12X\x0A\x14followup_intent_info\x18\x12 \x03(\x0B25.google.cloud.dialogflow.v2.Intent.FollowupIntentInfoB\x03\xE0A\x03\x1A\xF6\x02\x0A\x0ETrainingPhrase\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x03\x12I\x0A\x04type\x18\x02 \x01(\x0E26.google.cloud.dialogflow.v2.Intent.TrainingPhrase.TypeB\x03\xE0A\x02\x12J\x0A\x05parts\x18\x03 \x03(\x0B26.google.cloud.dialogflow.v2.Intent.TrainingPhrase.PartB\x03\xE0A\x02\x12\x1E\x0A\x11times_added_count\x18\x04 \x01(\x05B\x03\xE0A\x01\x1A]\x0A\x04Part\x12\x0C\x0A\x04text\x18\x01 \x01(\x09\x12\x18\x0A\x0Bentity_type\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x12\x0A\x05alias\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cuser_defined\x18\x04 \x01(\x08B\x03\xE0A\x01\";\x0A\x04Type\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07EXAMPLE\x10\x01\x12\x10\x0A\x08TEMPLATE\x10\x02\x1A\x02\x08\x01\x1A\xCA\x01\x0A\x09Parameter\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x14\x0A\x0Cdisplay_name\x18\x02 \x01(\x09\x12\x12\x0A\x05value\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x1A\x0A\x0Ddefault_value\x18\x04 \x01(\x09B\x03\xE0A\x01\x12%\x0A\x18entity_type_display_name\x18\x05 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09mandatory\x18\x06 \x01(\x08B\x03\xE0A\x01\x12\x14\x0A\x07prompts\x18\x07 \x03(\x09B\x03\xE0A\x01\x12\x14\x0A\x07is_list\x18\x08 \x01(\x08B\x03\xE0A\x01\x1A\x96*\x0A\x07Message\x12?\x0A\x04text\x18\x01 \x01(\x0B2/.google.cloud.dialogflow.v2.Intent.Message.TextH\x00\x12A\x0A\x05image\x18\x02 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageH\x00\x12P\x0A\x0Dquick_replies\x18\x03 \x01(\x0B27.google.cloud.dialogflow.v2.Intent.Message.QuickRepliesH\x00\x12?\x0A\x04card\x18\x04 \x01(\x0B2/.google.cloud.dialogflow.v2.Intent.Message.CardH\x00\x12*\x0A\x07payload\x18\x05 \x01(\x0B2\x17.google.protobuf.StructH\x00\x12V\x0A\x10simple_responses\x18\x07 \x01(\x0B2:.google.cloud.dialogflow.v2.Intent.Message.SimpleResponsesH\x00\x12J\x0A\x0Abasic_card\x18\x08 \x01(\x0B24.google.cloud.dialogflow.v2.Intent.Message.BasicCardH\x00\x12M\x0A\x0Bsuggestions\x18\x09 \x01(\x0B26.google.cloud.dialogflow.v2.Intent.Message.SuggestionsH\x00\x12[\x0A\x13link_out_suggestion\x18\x0A \x01(\x0B2<.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestionH\x00\x12L\x0A\x0Blist_select\x18\x0B \x01(\x0B25.google.cloud.dialogflow.v2.Intent.Message.ListSelectH\x00\x12T\x0A\x0Fcarousel_select\x18\x0C \x01(\x0B29.google.cloud.dialogflow.v2.Intent.Message.CarouselSelectH\x00\x12]\x0A\x14browse_carousel_card\x18\x16 \x01(\x0B2=.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCardH\x00\x12J\x0A\x0Atable_card\x18\x17 \x01(\x0B24.google.cloud.dialogflow.v2.Intent.Message.TableCardH\x00\x12P\x0A\x0Dmedia_content\x18\x18 \x01(\x0B27.google.cloud.dialogflow.v2.Intent.Message.MediaContentH\x00\x12J\x0A\x08platform\x18\x06 \x01(\x0E23.google.cloud.dialogflow.v2.Intent.Message.PlatformB\x03\xE0A\x01\x1A\x19\x0A\x04Text\x12\x11\x0A\x04text\x18\x01 \x03(\x09B\x03\xE0A\x01\x1A@\x0A\x05Image\x12\x16\x0A\x09image_uri\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x1F\x0A\x12accessibility_text\x18\x02 \x01(\x09B\x03\xE0A\x01\x1A>\x0A\x0CQuickReplies\x12\x12\x0A\x05title\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x1A\x0A\x0Dquick_replies\x18\x02 \x03(\x09B\x03\xE0A\x01\x1A\xCB\x01\x0A\x04Card\x12\x12\x0A\x05title\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08subtitle\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09image_uri\x18\x03 \x01(\x09B\x03\xE0A\x01\x12L\x0A\x07buttons\x18\x04 \x03(\x0B26.google.cloud.dialogflow.v2.Intent.Message.Card.ButtonB\x03\xE0A\x01\x1A2\x0A\x06Button\x12\x11\x0A\x04text\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08postback\x18\x02 \x01(\x09B\x03\xE0A\x01\x1AQ\x0A\x0ESimpleResponse\x12\x16\x0A\x0Etext_to_speech\x18\x01 \x01(\x09\x12\x0C\x0A\x04ssml\x18\x02 \x01(\x09\x12\x19\x0A\x0Cdisplay_text\x18\x03 \x01(\x09B\x03\xE0A\x01\x1Ak\x0A\x0FSimpleResponses\x12X\x0A\x10simple_responses\x18\x01 \x03(\x0B29.google.cloud.dialogflow.v2.Intent.Message.SimpleResponseB\x03\xE0A\x02\x1A\x88\x03\x0A\x09BasicCard\x12\x12\x0A\x05title\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08subtitle\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x0Eformatted_text\x18\x03 \x01(\x09\x12D\x0A\x05image\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01\x12Q\x0A\x07buttons\x18\x05 \x03(\x0B2;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.ButtonB\x03\xE0A\x01\x1A\x9E\x01\x0A\x06Button\x12\x0D\x0A\x05title\x18\x01 \x01(\x09\x12g\x0A\x0Fopen_uri_action\x18\x02 \x01(\x0B2I.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriActionB\x03\xE0A\x02\x1A\x1C\x0A\x0DOpenUriAction\x12\x0B\x0A\x03uri\x18\x01 \x01(\x09\x1A \x0A\x0ASuggestion\x12\x12\x0A\x05title\x18\x01 \x01(\x09B\x03\xE0A\x02\x1A^\x0A\x0BSuggestions\x12O\x0A\x0Bsuggestions\x18\x01 \x03(\x0B25.google.cloud.dialogflow.v2.Intent.Message.SuggestionB\x03\xE0A\x02\x1AD\x0A\x11LinkOutSuggestion\x12\x1D\x0A\x10destination_name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x10\x0A\x03uri\x18\x02 \x01(\x09B\x03\xE0A\x02\x1A\xD2\x02\x0A\x0AListSelect\x12\x12\x0A\x05title\x18\x01 \x01(\x09B\x03\xE0A\x01\x12N\x0A\x05items\x18\x02 \x03(\x0B2:.google.cloud.dialogflow.v2.Intent.Message.ListSelect.ItemB\x03\xE0A\x02\x12\x15\x0A\x08subtitle\x18\x03 \x01(\x09B\x03\xE0A\x01\x1A\xC8\x01\x0A\x04Item\x12L\x0A\x04info\x18\x01 \x01(\x0B29.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfoB\x03\xE0A\x02\x12\x12\x0A\x05title\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bdescription\x18\x03 \x01(\x09B\x03\xE0A\x01\x12D\x0A\x05image\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01\x1A\xAF\x02\x0A\x0ECarouselSelect\x12R\x0A\x05items\x18\x01 \x03(\x0B2>.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.ItemB\x03\xE0A\x02\x1A\xC8\x01\x0A\x04Item\x12L\x0A\x04info\x18\x01 \x01(\x0B29.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfoB\x03\xE0A\x02\x12\x12\x0A\x05title\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bdescription\x18\x03 \x01(\x09B\x03\xE0A\x01\x12D\x0A\x05image\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01\x1A9\x0A\x0ESelectItemInfo\x12\x10\x0A\x03key\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x15\x0A\x08synonyms\x18\x02 \x03(\x09B\x03\xE0A\x01\x1A\x8E\x04\x0A\x0CMediaContent\x12b\x0A\x0Amedia_type\x18\x01 \x01(\x0E2I.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaTypeB\x03\xE0A\x01\x12b\x0A\x0Dmedia_objects\x18\x02 \x03(\x0B2K.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject\x1A\xF0\x01\x0A\x13ResponseMediaObject\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x01\x12L\x0A\x0Blarge_image\x18\x03 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01H\x00\x12E\x0A\x04icon\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01H\x00\x12\x13\x0A\x0Bcontent_url\x18\x05 \x01(\x09B\x07\x0A\x05image\"C\x0A\x11ResponseMediaType\x12#\x0A\x1FRESPONSE_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\x09\x0A\x05AUDIO\x10\x01\x1A\xFF\x06\x0A\x12BrowseCarouselCard\x12c\x0A\x05items\x18\x01 \x03(\x0B2T.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem\x12u\x0A\x15image_display_options\x18\x02 \x01(\x0E2Q.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptionsB\x03\xE0A\x01\x1A\x94\x04\x0A\x16BrowseCarouselCardItem\x12{\x0A\x0Fopen_uri_action\x18\x01 \x01(\x0B2b.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction\x12\x0D\x0A\x05title\x18\x02 \x01(\x09\x12\x18\x0A\x0Bdescription\x18\x03 \x01(\x09B\x03\xE0A\x01\x12D\x0A\x05image\x18\x04 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01\x12\x13\x0A\x06footer\x18\x05 \x01(\x09B\x03\xE0A\x01\x1A\xF8\x01\x0A\x0DOpenUrlAction\x12\x0B\x0A\x03url\x18\x01 \x01(\x09\x12\x8A\x01\x0A\x0Durl_type_hint\x18\x03 \x01(\x0E2n.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHintB\x03\xE0A\x01\"M\x0A\x0BUrlTypeHint\x12\x1D\x0A\x19URL_TYPE_HINT_UNSPECIFIED\x10\x00\x12\x0E\x0A\x0AAMP_ACTION\x10\x01\x12\x0F\x0A\x0BAMP_CONTENT\x10\x02\"v\x0A\x13ImageDisplayOptions\x12%\x0A!IMAGE_DISPLAY_OPTIONS_UNSPECIFIED\x10\x00\x12\x08\x0A\x04GRAY\x10\x01\x12\x09\x0A\x05WHITE\x10\x02\x12\x0B\x0A\x07CROPPED\x10\x03\x12\x16\x0A\x12BLURRED_BACKGROUND\x10\x04\x1A\xF3\x02\x0A\x09TableCard\x12\x0D\x0A\x05title\x18\x01 \x01(\x09\x12\x15\x0A\x08subtitle\x18\x02 \x01(\x09B\x03\xE0A\x01\x12D\x0A\x05image\x18\x03 \x01(\x0B20.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xE0A\x01\x12[\x0A\x11column_properties\x18\x04 \x03(\x0B2;.google.cloud.dialogflow.v2.Intent.Message.ColumnPropertiesB\x03\xE0A\x01\x12J\x0A\x04rows\x18\x05 \x03(\x0B27.google.cloud.dialogflow.v2.Intent.Message.TableCardRowB\x03\xE0A\x01\x12Q\x0A\x07buttons\x18\x06 \x03(\x0B2;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.ButtonB\x03\xE0A\x01\x1A\xFA\x01\x0A\x10ColumnProperties\x12\x0E\x0A\x06header\x18\x01 \x01(\x09\x12r\x0A\x14horizontal_alignment\x18\x02 \x01(\x0E2O.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignmentB\x03\xE0A\x01\"b\x0A\x13HorizontalAlignment\x12\$\x0A HORIZONTAL_ALIGNMENT_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07LEADING\x10\x01\x12\x0A\x0A\x06CENTER\x10\x02\x12\x0C\x0A\x08TRAILING\x10\x03\x1Ax\x0A\x0CTableCardRow\x12L\x0A\x05cells\x18\x01 \x03(\x0B28.google.cloud.dialogflow.v2.Intent.Message.TableCardCellB\x03\xE0A\x01\x12\x1A\x0A\x0Ddivider_after\x18\x02 \x01(\x08B\x03\xE0A\x01\x1A\x1D\x0A\x0DTableCardCell\x12\x0C\x0A\x04text\x18\x01 \x01(\x09\"\xA0\x01\x0A\x08Platform\x12\x18\x0A\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08FACEBOOK\x10\x01\x12\x09\x0A\x05SLACK\x10\x02\x12\x0C\x0A\x08TELEGRAM\x10\x03\x12\x07\x0A\x03KIK\x10\x04\x12\x09\x0A\x05SKYPE\x10\x05\x12\x08\x0A\x04LINE\x10\x06\x12\x09\x0A\x05VIBER\x10\x07\x12\x15\x0A\x11ACTIONS_ON_GOOGLE\x10\x08\x12\x13\x0A\x0FGOOGLE_HANGOUTS\x10\x0BB\x09\x0A\x07message\x1AW\x0A\x12FollowupIntentInfo\x12\x1C\x0A\x14followup_intent_name\x18\x01 \x01(\x09\x12#\x0A\x1Bparent_followup_intent_name\x18\x02 \x01(\x09\"t\x0A\x0CWebhookState\x12\x1D\x0A\x19WEBHOOK_STATE_UNSPECIFIED\x10\x00\x12\x19\x0A\x15WEBHOOK_STATE_ENABLED\x10\x01\x12*\x0A&WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING\x10\x02:\x91\x01\xEAA\x8D\x01\x0A dialogflow.googleapis.com/Intent\x12)projects/{project}/agent/intents/{intent}\x12>projects/{project}/locations/{location}/agent/intents/{intent}\"\xDD\x01\x0A\x12ListIntentsRequest\x128\x0A\x06parent\x18\x01 \x01(\x09B(\xE0A\x02\xFAA\"\x12 dialogflow.googleapis.com/Intent\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x01\x12@\x0A\x0Bintent_view\x18\x03 \x01(\x0E2&.google.cloud.dialogflow.v2.IntentViewB\x03\xE0A\x01\x12\x16\x0A\x09page_size\x18\x04 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x05 \x01(\x09B\x03\xE0A\x01\"c\x0A\x13ListIntentsResponse\x123\x0A\x07intents\x18\x01 \x03(\x0B2\".google.cloud.dialogflow.v2.Intent\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\xA8\x01\x0A\x10GetIntentRequest\x126\x0A\x04name\x18\x01 \x01(\x09B(\xE0A\x02\xFAA\"\x0A dialogflow.googleapis.com/Intent\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x01\x12@\x0A\x0Bintent_view\x18\x03 \x01(\x0E2&.google.cloud.dialogflow.v2.IntentViewB\x03\xE0A\x01\"\xE6\x01\x0A\x13CreateIntentRequest\x128\x0A\x06parent\x18\x01 \x01(\x09B(\xE0A\x02\xFAA\"\x12 dialogflow.googleapis.com/Intent\x127\x0A\x06intent\x18\x02 \x01(\x0B2\".google.cloud.dialogflow.v2.IntentB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\x12@\x0A\x0Bintent_view\x18\x04 \x01(\x0E2&.google.cloud.dialogflow.v2.IntentViewB\x03\xE0A\x01\"\xE2\x01\x0A\x13UpdateIntentRequest\x127\x0A\x06intent\x18\x01 \x01(\x0B2\".google.cloud.dialogflow.v2.IntentB\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bupdate_mask\x18\x03 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\x12@\x0A\x0Bintent_view\x18\x04 \x01(\x0E2&.google.cloud.dialogflow.v2.IntentViewB\x03\xE0A\x01\"M\x0A\x13DeleteIntentRequest\x126\x0A\x04name\x18\x01 \x01(\x09B(\xE0A\x02\xFAA\"\x0A dialogflow.googleapis.com/Intent\"\xDD\x02\x0A\x19BatchUpdateIntentsRequest\x128\x0A\x06parent\x18\x01 \x01(\x09B(\xE0A\x02\xFAA\"\x12 dialogflow.googleapis.com/Intent\x12\x1A\x0A\x10intent_batch_uri\x18\x02 \x01(\x09H\x00\x12F\x0A\x13intent_batch_inline\x18\x03 \x01(\x0B2'.google.cloud.dialogflow.v2.IntentBatchH\x00\x12\x1A\x0A\x0Dlanguage_code\x18\x04 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bupdate_mask\x18\x05 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\x12@\x0A\x0Bintent_view\x18\x06 \x01(\x0E2&.google.cloud.dialogflow.v2.IntentViewB\x03\xE0A\x01B\x0E\x0A\x0Cintent_batch\"Q\x0A\x1ABatchUpdateIntentsResponse\x123\x0A\x07intents\x18\x01 \x03(\x0B2\".google.cloud.dialogflow.v2.Intent\"\x8F\x01\x0A\x19BatchDeleteIntentsRequest\x128\x0A\x06parent\x18\x01 \x01(\x09B(\xE0A\x02\xFAA\"\x12 dialogflow.googleapis.com/Intent\x128\x0A\x07intents\x18\x02 \x03(\x0B2\".google.cloud.dialogflow.v2.IntentB\x03\xE0A\x02\"B\x0A\x0BIntentBatch\x123\x0A\x07intents\x18\x01 \x03(\x0B2\".google.cloud.dialogflow.v2.Intent*?\x0A\x0AIntentView\x12\x1B\x0A\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\x0A\x10INTENT_VIEW_FULL\x10\x012\xF3\x10\x0A\x07Intents\x12\xF0\x02\x0A\x0BListIntents\x12..google.cloud.dialogflow.v2.ListIntentsRequest\x1A/.google.cloud.dialogflow.v2.ListIntentsResponse\"\xFF\x01\xDAA\x06parent\xDAA\x14parent,language_code\x82\xD3\xE4\x93\x02\xD8\x01\x12%/v2/{parent=projects/*/agent}/intentsZ3\x121/v2/{parent=projects/*/locations/*/agent}/intentsZ6\x124/v2/{parent=projects/*/agent/environments/*}/intentsZB\x12@/v2/{parent=projects/*/locations/*/agent/environments/*}/intents\x12\xDD\x01\x0A\x09GetIntent\x12,.google.cloud.dialogflow.v2.GetIntentRequest\x1A\".google.cloud.dialogflow.v2.Intent\"~\xDAA\x04name\xDAA\x12name,language_code\x82\xD3\xE4\x93\x02\\\x12%/v2/{name=projects/*/agent/intents/*}Z3\x121/v2/{name=projects/*/locations/*/agent/intents/*}\x12\x86\x02\x0A\x0CCreateIntent\x12/.google.cloud.dialogflow.v2.CreateIntentRequest\x1A\".google.cloud.dialogflow.v2.Intent\"\xA0\x01\xDAA\x0Dparent,intent\xDAA\x1Bparent,intent,language_code\x82\xD3\xE4\x93\x02l\"%/v2/{parent=projects/*/agent}/intents:\x06intentZ;\"1/v2/{parent=projects/*/locations/*/agent}/intents:\x06intent\x12\xA0\x02\x0A\x0CUpdateIntent\x12/.google.cloud.dialogflow.v2.UpdateIntentRequest\x1A\".google.cloud.dialogflow.v2.Intent\"\xBA\x01\xDAA\x14intent,language_code\xDAA intent,language_code,update_mask\x82\xD3\xE4\x93\x02z2,/v2/{intent.name=projects/*/agent/intents/*}:\x06intentZB28/v2/{intent.name=projects/*/locations/*/agent/intents/*}:\x06intent\x12\xC2\x01\x0A\x0CDeleteIntent\x12/.google.cloud.dialogflow.v2.DeleteIntentRequest\x1A\x16.google.protobuf.Empty\"i\xDAA\x04name\x82\xD3\xE4\x93\x02\\*%/v2/{name=projects/*/agent/intents/*}Z3*1/v2/{name=projects/*/locations/*/agent/intents/*}\x12\xF6\x02\x0A\x12BatchUpdateIntents\x125.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest\x1A\x1D.google.longrunning.Operation\"\x89\x02\xCAAO\x0A5google.cloud.dialogflow.v2.BatchUpdateIntentsResponse\x12\x16google.protobuf.Struct\xDAA\x17parent,intent_batch_uri\xDAA\x1Aparent,intent_batch_inline\x82\xD3\xE4\x93\x02z\"1/v2/{parent=projects/*/agent}/intents:batchUpdate:\x01*ZB\"=/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate:\x01*\x12\xB0\x02\x0A\x12BatchDeleteIntents\x125.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest\x1A\x1D.google.longrunning.Operation\"\xC3\x01\xCAA/\x0A\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xDAA\x0Eparent,intents\x82\xD3\xE4\x93\x02z\"1/v2/{parent=projects/*/agent}/intents:batchDelete:\x01*ZB\"=/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x91\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0BIntentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php new file mode 100644 index 000000000000..4f70a0bd1c29 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + "\x0A\xDB\x18\x0A/google/cloud/dialogflow/v2/knowledge_base.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\"\xFC\x01\x0A\x0DKnowledgeBase\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x19\x0A\x0Cdisplay_name\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x15\x0A\x0Dlanguage_code\x18\x04 \x01(\x09:\xAA\x01\xEAA\xA6\x01\x0A'dialogflow.googleapis.com/KnowledgeBase\x122projects/{project}/knowledgeBases/{knowledge_base}\x12Gprojects/{project}/locations/{location}/knowledgeBases/{knowledge_base}\"\x93\x01\x0A\x19ListKnowledgeBasesRequest\x12?\x0A\x06parent\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x12'dialogflow.googleapis.com/KnowledgeBase\x12\x11\x0A\x09page_size\x18\x02 \x01(\x05\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\x12\x0E\x0A\x06filter\x18\x04 \x01(\x09\"y\x0A\x1AListKnowledgeBasesResponse\x12B\x0A\x0Fknowledge_bases\x18\x01 \x03(\x0B2).google.cloud.dialogflow.v2.KnowledgeBase\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"X\x0A\x17GetKnowledgeBaseRequest\x12=\x0A\x04name\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x0A'dialogflow.googleapis.com/KnowledgeBase\"\xA5\x01\x0A\x1ACreateKnowledgeBaseRequest\x12?\x0A\x06parent\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x12'dialogflow.googleapis.com/KnowledgeBase\x12F\x0A\x0Eknowledge_base\x18\x02 \x01(\x0B2).google.cloud.dialogflow.v2.KnowledgeBaseB\x03\xE0A\x02\"o\x0A\x1ADeleteKnowledgeBaseRequest\x12=\x0A\x04name\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x0A'dialogflow.googleapis.com/KnowledgeBase\x12\x12\x0A\x05force\x18\x02 \x01(\x08B\x03\xE0A\x01\"\x9A\x01\x0A\x1AUpdateKnowledgeBaseRequest\x12F\x0A\x0Eknowledge_base\x18\x01 \x01(\x0B2).google.cloud.dialogflow.v2.KnowledgeBaseB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x012\xB4\x0D\x0A\x0EKnowledgeBases\x12\xA4\x02\x0A\x12ListKnowledgeBases\x125.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest\x1A6.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse\"\x9E\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02\x8E\x01\x12&/v2/{parent=projects/*}/knowledgeBasesZ4\x122/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.\x12,/v2/{parent=projects/*/agent}/knowledgeBases\x12\x91\x02\x0A\x10GetKnowledgeBase\x123.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest\x1A).google.cloud.dialogflow.v2.KnowledgeBase\"\x9C\x01\xDAA\x04name\x82\xD3\xE4\x93\x02\x8E\x01\x12&/v2/{name=projects/*/knowledgeBases/*}Z4\x122/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.\x12,/v2/{name=projects/*/agent/knowledgeBases/*}\x12\xD8\x02\x0A\x13CreateKnowledgeBase\x126.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest\x1A).google.cloud.dialogflow.v2.KnowledgeBase\"\xDD\x01\xDAA\x15parent,knowledge_base\x82\xD3\xE4\x93\x02\xBE\x01\"&/v2/{parent=projects/*}/knowledgeBases:\x0Eknowledge_baseZD\"2/v2/{parent=projects/*/locations/*}/knowledgeBases:\x0Eknowledge_baseZ>\",/v2/{parent=projects/*/agent}/knowledgeBases:\x0Eknowledge_base\x12\x84\x02\x0A\x13DeleteKnowledgeBase\x126.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest\x1A\x16.google.protobuf.Empty\"\x9C\x01\xDAA\x04name\x82\xD3\xE4\x93\x02\x8E\x01*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}\x12\x8A\x03\x0A\x13UpdateKnowledgeBase\x126.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest\x1A).google.cloud.dialogflow.v2.KnowledgeBase\"\x8F\x02\xDAA\x1Aknowledge_base,update_mask\x82\xD3\xE4\x93\x02\xEB\x0125/v2/{knowledge_base.name=projects/*/knowledgeBases/*}:\x0Eknowledge_baseZS2A/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}:\x0Eknowledge_baseZM2;/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}:\x0Eknowledge_base\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x98\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x12KnowledgeBaseProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Operations.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Operations.php new file mode 100644 index 000000000000..a0efaff24716 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Operations.php @@ -0,0 +1,26 @@ +internalAddGeneratedFile( + "\x0A\xCF\x02\x0A+google/cloud/dialogflow/v2/operations.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\"I\x0A\$GeneratorEvaluationOperationMetadata\x12!\x0A\x14generator_evaluation\x18\x01 \x01(\x09B\x03\xE0A\x03B\x95\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0FOperationsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Participant.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Participant.php new file mode 100644 index 000000000000..72670488d907 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Participant.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + "\x0A\xAE\x93\x01\x0A,google/cloud/dialogflow/v2/participant.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A-google/cloud/dialogflow/v2/audio_config.proto\x1A*google/cloud/dialogflow/v2/generator.proto\x1A(google/cloud/dialogflow/v2/session.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x17google/rpc/status.proto\"\xF8\x06\x0A\x0BParticipant\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12?\x0A\x04role\x18\x02 \x01(\x0E2,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xE0A\x05\x12&\x0A\x19sip_recording_media_label\x18\x06 \x01(\x09B\x03\xE0A\x01\x12(\x0A\x1Bobfuscated_external_user_id\x18\x07 \x01(\x09B\x03\xE0A\x01\x12n\x0A\x1Adocuments_metadata_filters\x18\x08 \x03(\x0B2E.google.cloud.dialogflow.v2.Participant.DocumentsMetadataFiltersEntryB\x03\xE0A\x01\x12]\x0A\x14agent_desktop_source\x18\x0A \x01(\x0E2:.google.cloud.dialogflow.v2.Participant.AgentDesktopSourceB\x03\xE0A\x01\x1A?\x0A\x1DDocumentsMetadataFiltersEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"P\x0A\x04Role\x12\x14\x0A\x10ROLE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BHUMAN_AGENT\x10\x01\x12\x13\x0A\x0FAUTOMATED_AGENT\x10\x02\x12\x0C\x0A\x08END_USER\x10\x03\"\x85\x01\x0A\x12AgentDesktopSource\x12\$\x0A AGENT_DESKTOP_SOURCE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BLIVE_PERSON\x10\x01\x12\x11\x0A\x0DGENESYS_CLOUD\x10\x02\x12\x0A\x0A\x06TWILIO\x10\x03\x12\x0E\x0A\x0ASALESFORCE\x10\x04\x12\x09\x0A\x05OTHER\x10\x08:\xD8\x01\xEAA\xD4\x01\x0A%dialogflow.googleapis.com/Participant\x12Jprojects/{project}/conversations/{conversation}/participants/{participant}\x12_projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}\"\x8C\x05\x0A\x07Message\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x14\x0A\x07content\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bparticipant\x18\x04 \x01(\x09B\x03\xE0A\x03\x12K\x0A\x10participant_role\x18\x05 \x01(\x0E2,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xE0A\x03\x124\x0A\x0Bcreate_time\x18\x06 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x122\x0A\x09send_time\x18\x09 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x01\x12N\x0A\x12message_annotation\x18\x07 \x01(\x0B2-.google.cloud.dialogflow.v2.MessageAnnotationB\x03\xE0A\x03\x12T\x0A\x12sentiment_analysis\x18\x08 \x01(\x0B23.google.cloud.dialogflow.v2.SentimentAnalysisResultB\x03\xE0A\x03:\xC4\x01\xEAA\xC0\x01\x0A!dialogflow.googleapis.com/Message\x12Bprojects/{project}/conversations/{conversation}/messages/{message}\x12Wprojects/{project}/locations/{location}/conversations/{conversation}/messages/{message}\"\x9C\x01\x0A\x18CreateParticipantRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x12%dialogflow.googleapis.com/Participant\x12A\x0A\x0Bparticipant\x18\x02 \x01(\x0B2'.google.cloud.dialogflow.v2.ParticipantB\x03\xE0A\x02\"T\x0A\x15GetParticipantRequest\x12;\x0A\x04name\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\"\x89\x01\x0A\x17ListParticipantsRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x12%dialogflow.googleapis.com/Participant\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"r\x0A\x18ListParticipantsResponse\x12=\x0A\x0Cparticipants\x18\x01 \x03(\x0B2'.google.cloud.dialogflow.v2.Participant\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\x93\x01\x0A\x18UpdateParticipantRequest\x12A\x0A\x0Bparticipant\x18\x01 \x01(\x0B2'.google.cloud.dialogflow.v2.ParticipantB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\"\x8A\x05\x0A\x15AnalyzeContentRequest\x12B\x0A\x0Bparticipant\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\x12;\x0A\x0Atext_input\x18\x06 \x01(\x0B2%.google.cloud.dialogflow.v2.TextInputH\x00\x12=\x0A\x0Baudio_input\x18\x07 \x01(\x0B2&.google.cloud.dialogflow.v2.AudioInputH\x00\x12=\x0A\x0Bevent_input\x18\x08 \x01(\x0B2&.google.cloud.dialogflow.v2.EventInputH\x00\x12G\x0A\x10suggestion_input\x18\x0C \x01(\x0B2+.google.cloud.dialogflow.v2.SuggestionInputH\x00\x12I\x0A\x12reply_audio_config\x18\x05 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\x12A\x0A\x0Cquery_params\x18\x09 \x01(\x0B2+.google.cloud.dialogflow.v2.QueryParameters\x12N\x0A\x13assist_query_params\x18\x0E \x01(\x0B21.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\x0A\x0Dcx_parameters\x18\x12 \x01(\x0B2\x17.google.protobuf.Struct\x12\x12\x0A\x0Arequest_id\x18\x0B \x01(\x09B\x07\x0A\x05input\",\x0A\x0EDtmfParameters\x12\x1A\x0A\x12accepts_dtmf_input\x18\x01 \x01(\x08\"\xDE\x03\x0A\x16AnalyzeContentResponse\x12\x12\x0A\x0Areply_text\x18\x01 \x01(\x09\x12<\x0A\x0Breply_audio\x18\x02 \x01(\x0B2'.google.cloud.dialogflow.v2.OutputAudio\x12N\x0A\x15automated_agent_reply\x18\x03 \x01(\x0B2/.google.cloud.dialogflow.v2.AutomatedAgentReply\x124\x0A\x07message\x18\x05 \x01(\x0B2#.google.cloud.dialogflow.v2.Message\x12T\x0A\x1Ehuman_agent_suggestion_results\x18\x06 \x03(\x0B2,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\x0A\x1Bend_user_suggestion_results\x18\x07 \x03(\x0B2,.google.cloud.dialogflow.v2.SuggestionResult\x12C\x0A\x0Fdtmf_parameters\x18\x09 \x01(\x0B2*.google.cloud.dialogflow.v2.DtmfParameters\"\xA6\x06\x0A\x1EStreamingAnalyzeContentRequest\x12B\x0A\x0Bparticipant\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\x12D\x0A\x0Caudio_config\x18\x02 \x01(\x0B2,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12B\x0A\x0Btext_config\x18\x03 \x01(\x0B2+.google.cloud.dialogflow.v2.InputTextConfigH\x00\x12I\x0A\x12reply_audio_config\x18\x04 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x15\x0A\x0Binput_audio\x18\x05 \x01(\x0CH\x01\x12\x14\x0A\x0Ainput_text\x18\x06 \x01(\x09H\x01\x12E\x0A\x0Ainput_dtmf\x18\x09 \x01(\x0B2/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\x01\x12A\x0A\x0Cquery_params\x18\x07 \x01(\x0B2+.google.cloud.dialogflow.v2.QueryParameters\x12N\x0A\x13assist_query_params\x18\x08 \x01(\x0B21.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\x0A\x0Dcx_parameters\x18\x0D \x01(\x0B2\x17.google.protobuf.Struct\x12&\x0A\x19enable_extended_streaming\x18\x0B \x01(\x08B\x03\xE0A\x01\x121\x0A\$enable_partial_automated_agent_reply\x18\x0C \x01(\x08B\x03\xE0A\x01\x12'\x0A\x1Aoutput_multiple_utterances\x18\x12 \x01(\x08B\x03\xE0A\x01\x12\x1D\x0A\x15enable_debugging_info\x18\x13 \x01(\x08B\x08\x0A\x06configB\x07\x0A\x05input\"\xA5\x05\x0A\x1FStreamingAnalyzeContentResponse\x12R\x0A\x12recognition_result\x18\x01 \x01(\x0B26.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12\x12\x0A\x0Areply_text\x18\x02 \x01(\x09\x12<\x0A\x0Breply_audio\x18\x03 \x01(\x0B2'.google.cloud.dialogflow.v2.OutputAudio\x12N\x0A\x15automated_agent_reply\x18\x04 \x01(\x0B2/.google.cloud.dialogflow.v2.AutomatedAgentReply\x124\x0A\x07message\x18\x06 \x01(\x0B2#.google.cloud.dialogflow.v2.Message\x12T\x0A\x1Ehuman_agent_suggestion_results\x18\x07 \x03(\x0B2,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\x0A\x1Bend_user_suggestion_results\x18\x08 \x03(\x0B2,.google.cloud.dialogflow.v2.SuggestionResult\x12C\x0A\x0Fdtmf_parameters\x18\x0A \x01(\x0B2*.google.cloud.dialogflow.v2.DtmfParameters\x12R\x0A\x0Edebugging_info\x18\x0B \x01(\x0B2:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\x12\x14\x0A\x0Cspeech_model\x18\x0D \x01(\x09\"\x85\x02\x0A\x16SuggestArticlesRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\x12A\x0A\x0Elatest_message\x18\x02 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x19\x0A\x0Ccontext_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12N\x0A\x13assist_query_params\x18\x04 \x01(\x0B21.google.cloud.dialogflow.v2.AssistQueryParameters\"\x8B\x01\x0A\x17SuggestArticlesResponse\x12B\x0A\x0Farticle_answers\x18\x01 \x03(\x0B2).google.cloud.dialogflow.v2.ArticleAnswer\x12\x16\x0A\x0Elatest_message\x18\x02 \x01(\x09\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\"\x87\x02\x0A\x18SuggestFaqAnswersRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\x12A\x0A\x0Elatest_message\x18\x02 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x19\x0A\x0Ccontext_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12N\x0A\x13assist_query_params\x18\x04 \x01(\x0B21.google.cloud.dialogflow.v2.AssistQueryParameters\"\x85\x01\x0A\x19SuggestFaqAnswersResponse\x12:\x0A\x0Bfaq_answers\x18\x01 \x03(\x0B2%.google.cloud.dialogflow.v2.FaqAnswer\x12\x16\x0A\x0Elatest_message\x18\x02 \x01(\x09\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\"\xA1\x03\x0A\x1BGenerateSuggestionsResponse\x12w\x0A\x1Cgenerator_suggestion_answers\x18\x01 \x03(\x0B2Q.google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\x12>\x0A\x0Elatest_message\x18\x02 \x01(\x09B&\xFAA#\x0A!dialogflow.googleapis.com/Message\x1A\xC8\x01\x0A\x19GeneratorSuggestionAnswer\x12M\x0A\x14generator_suggestion\x18\x01 \x01(\x0B2/.google.cloud.dialogflow.v2.GeneratorSuggestion\x12\x18\x0A\x10source_generator\x18\x02 \x01(\x09\x12B\x0A\x0Danswer_record\x18\x03 \x01(\x09B+\xFAA(\x0A&dialogflow.googleapis.com/AnswerRecord\"\xF4\x01\x0A\x1ASuggestSmartRepliesRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\x12A\x0A\x12current_text_input\x18\x04 \x01(\x0B2%.google.cloud.dialogflow.v2.TextInput\x12>\x0A\x0Elatest_message\x18\x02 \x01(\x09B&\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\"\xC3\x01\x0A\x1BSuggestSmartRepliesResponse\x12N\x0A\x13smart_reply_answers\x18\x01 \x03(\x0B2,.google.cloud.dialogflow.v2.SmartReplyAnswerB\x03\xE0A\x03\x12>\x0A\x0Elatest_message\x18\x02 \x01(\x09B&\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\"c\x0A\x0AAudioInput\x12A\x0A\x06config\x18\x01 \x01(\x0B2,.google.cloud.dialogflow.v2.InputAudioConfigB\x03\xE0A\x02\x12\x12\x0A\x05audio\x18\x02 \x01(\x0CB\x03\xE0A\x02\"[\x0A\x0BOutputAudio\x12=\x0A\x06config\x18\x01 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x0D\x0A\x05audio\x18\x02 \x01(\x0C\"\xE8\x02\x0A\x13AutomatedAgentReply\x12P\x0A\x16detect_intent_response\x18\x01 \x01(\x0B20.google.cloud.dialogflow.v2.DetectIntentResponse\x12k\x0A\x1Aautomated_agent_reply_type\x18\x07 \x01(\x0E2G.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType\x12\x1A\x0A\x12allow_cancellation\x18\x08 \x01(\x08\x12\x17\x0A\x0Fcx_current_page\x18\x0B \x01(\x09\"]\x0A\x17AutomatedAgentReplyType\x12*\x0A&AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07PARTIAL\x10\x01\x12\x09\x0A\x05FINAL\x10\x02\"\xE4\x01\x0A\x0DArticleAnswer\x12\x0D\x0A\x05title\x18\x01 \x01(\x09\x12\x0B\x0A\x03uri\x18\x02 \x01(\x09\x12\x10\x0A\x08snippets\x18\x03 \x03(\x09\x12\x12\x0A\x0Aconfidence\x18\x04 \x01(\x02\x12I\x0A\x08metadata\x18\x05 \x03(\x0B27.google.cloud.dialogflow.v2.ArticleAnswer.MetadataEntry\x12\x15\x0A\x0Danswer_record\x18\x06 \x01(\x09\x1A/\x0A\x0DMetadataEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\xE0\x01\x0A\x09FaqAnswer\x12\x0E\x0A\x06answer\x18\x01 \x01(\x09\x12\x12\x0A\x0Aconfidence\x18\x02 \x01(\x02\x12\x10\x0A\x08question\x18\x03 \x01(\x09\x12\x0E\x0A\x06source\x18\x04 \x01(\x09\x12E\x0A\x08metadata\x18\x05 \x03(\x0B23.google.cloud.dialogflow.v2.FaqAnswer.MetadataEntry\x12\x15\x0A\x0Danswer_record\x18\x06 \x01(\x09\x1A/\x0A\x0DMetadataEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"y\x0A\x10SmartReplyAnswer\x12\x0D\x0A\x05reply\x18\x01 \x01(\x09\x12\x12\x0A\x0Aconfidence\x18\x02 \x01(\x02\x12B\x0A\x0Danswer_record\x18\x03 \x01(\x09B+\xFAA(\x0A&dialogflow.googleapis.com/AnswerRecord\"\\\x0A\x10IntentSuggestion\x12\x14\x0A\x0Cdisplay_name\x18\x01 \x01(\x09\x12\x13\x0A\x09intent_v2\x18\x02 \x01(\x09H\x00\x12\x13\x0A\x0Bdescription\x18\x05 \x01(\x09B\x08\x0A\x06intent\"\xC5\x01\x0A\x16DialogflowAssistAnswer\x12?\x0A\x0Cquery_result\x18\x01 \x01(\x0B2'.google.cloud.dialogflow.v2.QueryResultH\x00\x12I\x0A\x11intent_suggestion\x18\x05 \x01(\x0B2,.google.cloud.dialogflow.v2.IntentSuggestionH\x00\x12\x15\x0A\x0Danswer_record\x18\x02 \x01(\x09B\x08\x0A\x06result\"\xB5\x04\x0A\x10SuggestionResult\x12#\x0A\x05error\x18\x01 \x01(\x0B2\x12.google.rpc.StatusH\x00\x12X\x0A\x19suggest_articles_response\x18\x02 \x01(\x0B23.google.cloud.dialogflow.v2.SuggestArticlesResponseH\x00\x12g\x0A!suggest_knowledge_assist_response\x18\x08 \x01(\x0B2:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponseH\x00\x12]\x0A\x1Csuggest_faq_answers_response\x18\x03 \x01(\x0B25.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\x00\x12a\x0A\x1Esuggest_smart_replies_response\x18\x04 \x01(\x0B27.google.cloud.dialogflow.v2.SuggestSmartRepliesResponseH\x00\x12`\x0A\x1Dgenerate_suggestions_response\x18\x09 \x01(\x0B27.google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\x00B\x15\x0A\x13suggestion_response\"-\x0A\x0FInputTextConfig\x12\x1A\x0A\x0Dlanguage_code\x18\x01 \x01(\x09B\x03\xE0A\x02\"j\x0A\x14AnnotatedMessagePart\x12\x0C\x0A\x04text\x18\x01 \x01(\x09\x12\x13\x0A\x0Bentity_type\x18\x02 \x01(\x09\x12/\x0A\x0Fformatted_value\x18\x03 \x01(\x0B2\x16.google.protobuf.Value\"n\x0A\x11MessageAnnotation\x12?\x0A\x05parts\x18\x01 \x03(\x0B20.google.cloud.dialogflow.v2.AnnotatedMessagePart\x12\x18\x0A\x10contain_entities\x18\x02 \x01(\x08\"\xA3\x02\x0A\x0FSuggestionInput\x12\x1A\x0A\x0Danswer_record\x18\x01 \x01(\x09B\x03\xE0A\x02\x120\x0A\x0Aparameters\x18\x04 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x12G\x0A\x06action\x18\x05 \x01(\x0E22.google.cloud.dialogflow.v2.SuggestionInput.ActionB\x03\xE0A\x01\x122\x0A\x09send_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x01\"E\x0A\x06Action\x12\x16\x0A\x12ACTION_UNSPECIFIED\x10\x00\x12\x0A\x0A\x06CANCEL\x10\x01\x12\x0A\x0A\x06REVISE\x10\x02\x12\x0B\x0A\x07CONFIRM\x10\x03\"\xCD\x01\x0A\x15AssistQueryParameters\x12s\x0A\x1Adocuments_metadata_filters\x18\x01 \x03(\x0B2O.google.cloud.dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\x1A?\x0A\x1DDocumentsMetadataFiltersEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\xE3\x01\x0A\x1DSuggestKnowledgeAssistRequest\x12=\x0A\x06parent\x18\x01 \x01(\x09B-\xE0A\x02\xFAA'\x0A%dialogflow.googleapis.com/Participant\x12A\x0A\x0Elatest_message\x18\x02 \x01(\x09B)\xE0A\x01\xFAA#\x0A!dialogflow.googleapis.com/Message\x12\x19\x0A\x0Ccontext_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12%\x0A\x18previous_suggested_query\x18\x04 \x01(\x09B\x03\xE0A\x01\"\xAB\x02\x0A\x1ESuggestKnowledgeAssistResponse\x12W\x0A\x17knowledge_assist_answer\x18\x01 \x01(\x0B21.google.cloud.dialogflow.v2.KnowledgeAssistAnswerB\x03\xE0A\x03\x12\x16\x0A\x0Elatest_message\x18\x02 \x01(\x09\x12\x14\x0A\x0Ccontext_size\x18\x03 \x01(\x05\x12\x81\x01\x0A\"additional_suggested_query_results\x18\x04 \x03(\x0B2P.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResultB\x03\xE0A\x01\"\xB9\x05\x0A!IngestedContextReferenceDebugInfo\x12\x1F\x0A\x17project_not_allowlisted\x18\x01 \x01(\x08\x12#\x0A\x1Bcontext_reference_retrieved\x18\x02 \x01(\x08\x12\x80\x01\x0A\x1Eingested_parameters_debug_info\x18\x03 \x03(\x0B2X.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\x1A\xCA\x03\x0A\x1AIngestedParameterDebugInfo\x12\x11\x0A\x09parameter\x18\x01 \x01(\x09\x12\x82\x01\x0A\x10ingestion_status\x18\x02 \x01(\x0E2h.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus\"\x93\x02\x0A\x0FIngestionStatus\x12 \x0A\x1CINGESTION_STATUS_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1AINGESTION_STATUS_SUCCEEDED\x10\x01\x12*\x0A&INGESTION_STATUS_CONTEXT_NOT_AVAILABLE\x10\x02\x12!\x0A\x1DINGESTION_STATUS_PARSE_FAILED\x10\x03\x12\"\x0A\x1EINGESTION_STATUS_INVALID_ENTRY\x10\x04\x12#\x0A\x1FINGESTION_STATUS_INVALID_FORMAT\x10\x05\x12&\x0A\"INGESTION_STATUS_LANGUAGE_MISMATCH\x10\x06\"\x97\x02\x0A\x0EServiceLatency\x12e\x0A\x1Ainternal_service_latencies\x18\x01 \x03(\x0B2A.google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency\x1A\x9D\x01\x0A\x16InternalServiceLatency\x12\x0C\x0A\x04step\x18\x01 \x01(\x09\x12\x12\x0A\x0Alatency_ms\x18\x02 \x01(\x02\x12.\x0A\x0Astart_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.Timestamp\x121\x0A\x0Dcomplete_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.Timestamp\"\x8C\x12\x0A\x18KnowledgeAssistDebugInfo\x12z\x0A\x1Fquery_generation_failure_reason\x18\x01 \x01(\x0E2Q.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason\x12\x82\x01\x0A#query_categorization_failure_reason\x18\x02 \x01(\x0E2U.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason\x12V\x0A\x19datastore_response_reason\x18\x03 \x01(\x0E23.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\x0A\x19knowledge_assist_behavior\x18\x04 \x01(\x0B2L.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\x12l\x0A%ingested_context_reference_debug_info\x18\x05 \x01(\x0B2=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12C\x0A\x0Fservice_latency\x18\x06 \x01(\x0B2*.google.cloud.dialogflow.v2.ServiceLatency\x12r\x0A\x1Bquery_generation_debug_info\x18\x07 \x01(\x0B2M.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo\x12/\x0A\x0Eces_debug_info\x18\x08 \x01(\x0B2\x17.google.protobuf.Struct\x1A\xB9\x05\x0A\x17KnowledgeAssistBehavior\x12%\x0A\x1Danswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\x0A\x1Aend_user_metadata_included\x18\x02 \x01(\x08\x12\x19\x0A\x11return_query_only\x18\x04 \x01(\x08\x12\x1B\x0A\x13use_pubsub_delivery\x18\x05 \x01(\x08\x12\x1D\x0A\x15disable_sync_delivery\x18\x06 \x01(\x08\x12!\x0A\x19previous_queries_included\x18\x07 \x01(\x08\x12\x1E\x0A\x16use_translated_message\x18\x08 \x01(\x08\x12&\x0A\x1Euse_custom_safety_filter_level\x18\x09 \x01(\x08\x123\x0A+conversation_transcript_has_mixed_languages\x18\x0A \x01(\x08\x120\x0A(query_generation_agent_language_mismatch\x18\x0B \x01(\x08\x123\x0A+query_generation_end_user_language_mismatch\x18\x0C \x01(\x08\x12%\x0A\x1Dthird_party_connector_allowed\x18\x0D \x01(\x08\x12\"\x0A\x1Amultiple_queries_generated\x18\x0E \x01(\x08\x12&\x0A\x1Equery_contained_search_context\x18\x0F \x01(\x08\x12.\x0A&invalid_items_query_suggestion_skipped\x18\x10 \x01(\x08\x12+\x0A#primary_query_redacted_and_replaced\x18\x11 \x01(\x08\x12%\x0A\x1Dappended_search_context_count\x18\x12 \x01(\x05\x1Aq\x0A\x18QueryGenerationDebugInfo\x12\x1A\x0A\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1E\x0A\x16candidates_token_count\x18\x02 \x01(\x05\x12\x19\x0A\x11total_token_count\x18\x03 \x01(\x05\"\xCF\x03\x0A\x1CQueryGenerationFailureReason\x12/\x0A+QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12!\x0A\x1DQUERY_GENERATION_OUT_OF_QUOTA\x10\x01\x12\x1B\x0A\x17QUERY_GENERATION_FAILED\x10\x02\x12'\x0A#QUERY_GENERATION_NO_QUERY_GENERATED\x10\x03\x12\x1F\x0A\x1BQUERY_GENERATION_RAI_FAILED\x10\x04\x12\x14\x0A\x10NOT_IN_ALLOWLIST\x10\x05\x12#\x0A\x1FQUERY_GENERATION_QUERY_REDACTED\x10\x06\x12.\x0A*QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED\x10\x0A\x12'\x0A#QUERY_GENERATION_EMPTY_CONVERSATION\x10\x0B\x12'\x0A#QUERY_GENERATION_EMPTY_LAST_MESSAGE\x10\x0C\x127\x0A3QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET\x10\x0D\"\xCC\x01\x0A QueryCategorizationFailureReason\x123\x0A/QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12'\x0A#QUERY_CATEGORIZATION_INVALID_CONFIG\x10\x01\x12)\x0A%QUERY_CATEGORIZATION_RESULT_NOT_FOUND\x10\x02\x12\x1F\x0A\x1BQUERY_CATEGORIZATION_FAILED\x10\x03\"\xC1\x0C\x0A\x15KnowledgeAssistAnswer\x12Y\x0A\x0Fsuggested_query\x18\x01 \x01(\x0B2@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\x12a\x0A\x16suggested_query_answer\x18\x02 \x01(\x0B2A.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer\x12\x15\x0A\x0Danswer_record\x18\x03 \x01(\x09\x12Y\x0A\x1Bknowledge_assist_debug_info\x18\x07 \x01(\x0B24.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo\x1A\xC9\x01\x0A\x0ESuggestedQuery\x12\x12\x0A\x0Aquery_text\x18\x01 \x01(\x09\x12l\x0A\x0Fsearch_contexts\x18\x04 \x03(\x0B2N.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContextB\x03\xE0A\x01\x1A5\x0A\x0DSearchContext\x12\x10\x0A\x03key\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x12\x0A\x05value\x18\x02 \x01(\x09B\x03\xE0A\x01\x1A\xC7\x01\x0A\x1EAdditionalSuggestedQueryResult\x12^\x0A\x0Fsuggested_query\x18\x01 \x01(\x0B2@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryB\x03\xE0A\x03\x12E\x0A\x0Danswer_record\x18\x05 \x01(\x09B.\xE0A\x03\xFAA(\x0A&dialogflow.googleapis.com/AnswerRecord\x1A\xE1\x06\x0A\x0FKnowledgeAnswer\x12\x13\x0A\x0Banswer_text\x18\x01 \x01(\x09\x12a\x0A\x0Afaq_source\x18\x03 \x01(\x0B2K.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\x00\x12o\x0A\x11generative_source\x18\x04 \x01(\x0B2R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12m\x0A\x0Fplaybook_source\x18\x07 \x01(\x0B2R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12e\x0A\x0Cevent_source\x18\x08 \x01(\x0B2M.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSourceH\x00\x1A\x1D\x0A\x09FaqSource\x12\x10\x0A\x08question\x18\x02 \x01(\x09\x1A\xE0\x01\x0A\x10GenerativeSource\x12l\x0A\x08snippets\x18\x01 \x03(\x0B2Z.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\x1A^\x0A\x07Snippet\x12\x0B\x0A\x03uri\x18\x02 \x01(\x09\x12\x0C\x0A\x04text\x18\x03 \x01(\x09\x12\x0D\x0A\x05title\x18\x04 \x01(\x09\x12)\x0A\x08metadata\x18\x05 \x01(\x0B2\x17.google.protobuf.Struct\x1A\x82\x01\x0A\x0BEventSource\x12\x0D\x0A\x05event\x18\x01 \x01(\x09\x12d\x0A\x08snippets\x18\x02 \x01(\x0B2R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceB\x08\x0A\x06source*\xD6\x02\x0A\x17DatastoreResponseReason\x12)\x0A%DATASTORE_RESPONSE_REASON_UNSPECIFIED\x10\x00\x12\x08\x0A\x04NONE\x10\x01\x12\x17\x0A\x13SEARCH_OUT_OF_QUOTA\x10\x02\x12\x18\x0A\x14SEARCH_EMPTY_RESULTS\x10\x03\x12%\x0A!ANSWER_GENERATION_GEN_AI_DISABLED\x10\x04\x12\"\x0A\x1EANSWER_GENERATION_OUT_OF_QUOTA\x10\x05\x12\x1B\x0A\x17ANSWER_GENERATION_ERROR\x10\x06\x12%\x0A!ANSWER_GENERATION_NOT_ENOUGH_INFO\x10\x07\x12 \x0A\x1CANSWER_GENERATION_RAI_FAILED\x10\x08\x12\"\x0A\x1EANSWER_GENERATION_NOT_GROUNDED\x10\x092\xFA\x18\x0A\x0CParticipants\x12\xA5\x02\x0A\x11CreateParticipant\x124.google.cloud.dialogflow.v2.CreateParticipantRequest\x1A'.google.cloud.dialogflow.v2.Participant\"\xB0\x01\xDAA\x12parent,participant\x82\xD3\xE4\x93\x02\x94\x01\"4/v2/{parent=projects/*/conversations/*}/participants:\x0BparticipantZO\"@/v2/{parent=projects/*/locations/*/conversations/*}/participants:\x0Bparticipant\x12\xF6\x01\x0A\x0EGetParticipant\x121.google.cloud.dialogflow.v2.GetParticipantRequest\x1A'.google.cloud.dialogflow.v2.Participant\"\x87\x01\xDAA\x04name\x82\xD3\xE4\x93\x02z\x124/v2/{name=projects/*/conversations/*/participants/*}ZB\x12@/v2/{name=projects/*/locations/*/conversations/*/participants/*}\x12\x89\x02\x0A\x10ListParticipants\x123.google.cloud.dialogflow.v2.ListParticipantsRequest\x1A4.google.cloud.dialogflow.v2.ListParticipantsResponse\"\x89\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02z\x124/v2/{parent=projects/*/conversations/*}/participantsZB\x12@/v2/{parent=projects/*/locations/*/conversations/*}/participants\x12\xC2\x02\x0A\x11UpdateParticipant\x124.google.cloud.dialogflow.v2.UpdateParticipantRequest\x1A'.google.cloud.dialogflow.v2.Participant\"\xCD\x01\xDAA\x17participant,update_mask\x82\xD3\xE4\x93\x02\xAC\x012@/v2/{participant.name=projects/*/conversations/*/participants/*}:\x0BparticipantZ[2L/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}:\x0Bparticipant\x12\xFA\x02\x0A\x0EAnalyzeContent\x121.google.cloud.dialogflow.v2.AnalyzeContentRequest\x1A2.google.cloud.dialogflow.v2.AnalyzeContentResponse\"\x80\x02\xDAA\x16participant,text_input\xDAA\x17participant,event_input\xDAA\x17participant,audio_input\x82\xD3\xE4\x93\x02\xAC\x01\"J/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent:\x01*Z[\"V/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent:\x01*\x12\x98\x01\x0A\x17StreamingAnalyzeContent\x12:.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest\x1A;.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse\"\x00(\x010\x01\x12\xC9\x02\x0A\x0FSuggestArticles\x122.google.cloud.dialogflow.v2.SuggestArticlesRequest\x1A3.google.cloud.dialogflow.v2.SuggestArticlesResponse\"\xCC\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02\xBC\x01\"R/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*Zc\"^/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*\x12\xD3\x02\x0A\x11SuggestFaqAnswers\x124.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest\x1A5.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse\"\xD0\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02\xC0\x01\"T/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*Ze\"`/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*\x12\xDD\x02\x0A\x13SuggestSmartReplies\x126.google.cloud.dialogflow.v2.SuggestSmartRepliesRequest\x1A7.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse\"\xD4\x01\xDAA\x06parent\x82\xD3\xE4\x93\x02\xC4\x01\"V/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*Zg\"b/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*\x12\xE3\x02\x0A\x16SuggestKnowledgeAssist\x129.google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest\x1A:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse\"\xD1\x01\x82\xD3\xE4\x93\x02\xCA\x01\"Y/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*Zj\"e/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x10ParticipantProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Session.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Session.php new file mode 100644 index 000000000000..cd3bf58ead74 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Session.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + "\x0A\x8E2\x0A(google/cloud/dialogflow/v2/session.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A-google/cloud/dialogflow/v2/audio_config.proto\x1A(google/cloud/dialogflow/v2/context.proto\x1A'google/cloud/dialogflow/v2/intent.proto\x1A4google/cloud/dialogflow/v2/session_entity_type.proto\x1A\x1Egoogle/protobuf/duration.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x17google/rpc/status.proto\x1A\x18google/type/latlng.proto\"\xF5\x02\x0A\x13DetectIntentRequest\x12:\x0A\x07session\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!dialogflow.googleapis.com/Session\x12A\x0A\x0Cquery_params\x18\x02 \x01(\x0B2+.google.cloud.dialogflow.v2.QueryParameters\x12@\x0A\x0Bquery_input\x18\x03 \x01(\x0B2&.google.cloud.dialogflow.v2.QueryInputB\x03\xE0A\x02\x12J\x0A\x13output_audio_config\x18\x04 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\x12<\x0A\x18output_audio_config_mask\x18\x07 \x01(\x0B2\x1A.google.protobuf.FieldMask\x12\x13\x0A\x0Binput_audio\x18\x05 \x01(\x0C\"\xF8\x01\x0A\x14DetectIntentResponse\x12\x13\x0A\x0Bresponse_id\x18\x01 \x01(\x09\x12=\x0A\x0Cquery_result\x18\x02 \x01(\x0B2'.google.cloud.dialogflow.v2.QueryResult\x12*\x0A\x0Ewebhook_status\x18\x03 \x01(\x0B2\x12.google.rpc.Status\x12\x14\x0A\x0Coutput_audio\x18\x04 \x01(\x0C\x12J\x0A\x13output_audio_config\x18\x06 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\"\x9F\x04\x0A\x0FQueryParameters\x12\x11\x0A\x09time_zone\x18\x01 \x01(\x09\x12)\x0A\x0Cgeo_location\x18\x02 \x01(\x0B2\x13.google.type.LatLng\x125\x0A\x08contexts\x18\x03 \x03(\x0B2#.google.cloud.dialogflow.v2.Context\x12\x16\x0A\x0Ereset_contexts\x18\x04 \x01(\x08\x12K\x0A\x14session_entity_types\x18\x05 \x03(\x0B2-.google.cloud.dialogflow.v2.SessionEntityType\x12(\x0A\x07payload\x18\x06 \x01(\x0B2\x17.google.protobuf.Struct\x12e\x0A!sentiment_analysis_request_config\x18\x0A \x01(\x0B2:.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig\x12X\x0A\x0Fwebhook_headers\x18\x0E \x03(\x0B2?.google.cloud.dialogflow.v2.QueryParameters.WebhookHeadersEntry\x12\x10\x0A\x08platform\x18\x12 \x01(\x09\x1A5\x0A\x13WebhookHeadersEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\xCB\x01\x0A\x0AQueryInput\x12D\x0A\x0Caudio_config\x18\x01 \x01(\x0B2,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x125\x0A\x04text\x18\x02 \x01(\x0B2%.google.cloud.dialogflow.v2.TextInputH\x00\x127\x0A\x05event\x18\x03 \x01(\x0B2&.google.cloud.dialogflow.v2.EventInputH\x00B\x07\x0A\x05input\"\xAE\x05\x0A\x0BQueryResult\x12\x12\x0A\x0Aquery_text\x18\x01 \x01(\x09\x12\x15\x0A\x0Dlanguage_code\x18\x0F \x01(\x09\x12%\x0A\x1Dspeech_recognition_confidence\x18\x02 \x01(\x02\x12\x0E\x0A\x06action\x18\x03 \x01(\x09\x12+\x0A\x0Aparameters\x18\x04 \x01(\x0B2\x17.google.protobuf.Struct\x12#\x0A\x1Ball_required_params_present\x18\x05 \x01(\x08\x12\x1C\x0A\x14cancels_slot_filling\x18\x15 \x01(\x08\x12\x18\x0A\x10fulfillment_text\x18\x06 \x01(\x09\x12H\x0A\x14fulfillment_messages\x18\x07 \x03(\x0B2*.google.cloud.dialogflow.v2.Intent.Message\x12\x16\x0A\x0Ewebhook_source\x18\x08 \x01(\x09\x120\x0A\x0Fwebhook_payload\x18\x09 \x01(\x0B2\x17.google.protobuf.Struct\x12<\x0A\x0Foutput_contexts\x18\x0A \x03(\x0B2#.google.cloud.dialogflow.v2.Context\x122\x0A\x06intent\x18\x0B \x01(\x0B2\".google.cloud.dialogflow.v2.Intent\x12#\x0A\x1Bintent_detection_confidence\x18\x0C \x01(\x02\x120\x0A\x0Fdiagnostic_info\x18\x0E \x01(\x0B2\x17.google.protobuf.Struct\x12V\x0A\x19sentiment_analysis_result\x18\x11 \x01(\x0B23.google.cloud.dialogflow.v2.SentimentAnalysisResult\"\xBB\x03\x0A\x1CStreamingDetectIntentRequest\x12:\x0A\x07session\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!dialogflow.googleapis.com/Session\x12A\x0A\x0Cquery_params\x18\x02 \x01(\x0B2+.google.cloud.dialogflow.v2.QueryParameters\x12@\x0A\x0Bquery_input\x18\x03 \x01(\x0B2&.google.cloud.dialogflow.v2.QueryInputB\x03\xE0A\x02\x12\x1C\x0A\x10single_utterance\x18\x04 \x01(\x08B\x02\x18\x01\x12J\x0A\x13output_audio_config\x18\x05 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\x12<\x0A\x18output_audio_config_mask\x18\x07 \x01(\x0B2\x1A.google.protobuf.FieldMask\x12\x13\x0A\x0Binput_audio\x18\x06 \x01(\x0C\x12\x1D\x0A\x15enable_debugging_info\x18\x08 \x01(\x08\"\xB0\x07\x0A\x1ECloudConversationDebuggingInfo\x12\x19\x0A\x11audio_data_chunks\x18\x01 \x01(\x05\x129\x0A\x16result_end_time_offset\x18\x02 \x01(\x0B2\x19.google.protobuf.Duration\x127\x0A\x14first_audio_duration\x18\x03 \x01(\x0B2\x19.google.protobuf.Duration\x12\x18\x0A\x10single_utterance\x18\x05 \x01(\x08\x12C\x0A speech_partial_results_end_times\x18\x06 \x03(\x0B2\x19.google.protobuf.Duration\x12A\x0A\x1Espeech_final_results_end_times\x18\x07 \x03(\x0B2\x19.google.protobuf.Duration\x12\x19\x0A\x11partial_responses\x18\x08 \x01(\x05\x12,\x0A\$speaker_id_passive_latency_ms_offset\x18\x09 \x01(\x05\x12\x1F\x0A\x17bargein_event_triggered\x18\x0A \x01(\x08\x12\x1F\x0A\x17speech_single_utterance\x18\x0B \x01(\x08\x12=\x0A\x1Adtmf_partial_results_times\x18\x0C \x03(\x0B2\x19.google.protobuf.Duration\x12;\x0A\x18dtmf_final_results_times\x18\x0D \x03(\x0B2\x19.google.protobuf.Duration\x12C\x0A single_utterance_end_time_offset\x18\x0E \x01(\x0B2\x19.google.protobuf.Duration\x124\x0A\x11no_speech_timeout\x18\x0F \x01(\x0B2\x19.google.protobuf.Duration\x126\x0A\x13endpointing_timeout\x18\x13 \x01(\x0B2\x19.google.protobuf.Duration\x12\x15\x0A\x0Dis_input_text\x18\x10 \x01(\x08\x12@\x0A\x1Dclient_half_close_time_offset\x18\x11 \x01(\x0B2\x19.google.protobuf.Duration\x12J\x0A'client_half_close_streaming_time_offset\x18\x12 \x01(\x0B2\x19.google.protobuf.Duration\"\xA9\x03\x0A\x1DStreamingDetectIntentResponse\x12\x13\x0A\x0Bresponse_id\x18\x01 \x01(\x09\x12R\x0A\x12recognition_result\x18\x02 \x01(\x0B26.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12=\x0A\x0Cquery_result\x18\x03 \x01(\x0B2'.google.cloud.dialogflow.v2.QueryResult\x12*\x0A\x0Ewebhook_status\x18\x04 \x01(\x0B2\x12.google.rpc.Status\x12\x14\x0A\x0Coutput_audio\x18\x05 \x01(\x0C\x12J\x0A\x13output_audio_config\x18\x06 \x01(\x0B2-.google.cloud.dialogflow.v2.OutputAudioConfig\x12R\x0A\x0Edebugging_info\x18\x08 \x01(\x0B2:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\"\x9D\x03\x0A\x1AStreamingRecognitionResult\x12X\x0A\x0Cmessage_type\x18\x01 \x01(\x0E2B.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType\x12\x12\x0A\x0Atranscript\x18\x02 \x01(\x09\x12\x10\x0A\x08is_final\x18\x03 \x01(\x08\x12\x12\x0A\x0Aconfidence\x18\x04 \x01(\x02\x12D\x0A\x10speech_word_info\x18\x07 \x03(\x0B2*.google.cloud.dialogflow.v2.SpeechWordInfo\x124\x0A\x11speech_end_offset\x18\x08 \x01(\x0B2\x19.google.protobuf.Duration\x12\x15\x0A\x0Dlanguage_code\x18\x0A \x01(\x09\"X\x0A\x0BMessageType\x12\x1C\x0A\x18MESSAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0E\x0A\x0ATRANSCRIPT\x10\x01\x12\x1B\x0A\x17END_OF_SINGLE_UTTERANCE\x10\x02\":\x0A\x09TextInput\x12\x11\x0A\x04text\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dlanguage_code\x18\x02 \x01(\x09B\x03\xE0A\x02\"h\x0A\x0AEventInput\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12+\x0A\x0Aparameters\x18\x02 \x01(\x0B2\x17.google.protobuf.Struct\x12\x1A\x0A\x0Dlanguage_code\x18\x03 \x01(\x09B\x03\xE0A\x02\"F\x0A\x1ESentimentAnalysisRequestConfig\x12\$\x0A\x1Canalyze_query_text_sentiment\x18\x01 \x01(\x08\"^\x0A\x17SentimentAnalysisResult\x12C\x0A\x14query_text_sentiment\x18\x01 \x01(\x0B2%.google.cloud.dialogflow.v2.Sentiment\"-\x0A\x09Sentiment\x12\x0D\x0A\x05score\x18\x01 \x01(\x02\x12\x11\x0A\x09magnitude\x18\x02 \x01(\x022\xE5\x05\x0A\x08Sessions\x12\xC9\x03\x0A\x0CDetectIntent\x12/.google.cloud.dialogflow.v2.DetectIntentRequest\x1A0.google.cloud.dialogflow.v2.DetectIntentResponse\"\xD5\x02\xDAA\x13session,query_input\x82\xD3\xE4\x93\x02\xB8\x02\"6/v2/{session=projects/*/agent/sessions/*}:detectIntent:\x01*ZR\"M/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent:\x01*ZG\"B/v2/{session=projects/*/locations/*/agent/sessions/*}:detectIntent:\x01*Z^\"Y/v2/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent:\x01*\x12\x92\x01\x0A\x15StreamingDetectIntent\x128.google.cloud.dialogflow.v2.StreamingDetectIntentRequest\x1A9.google.cloud.dialogflow.v2.StreamingDetectIntentResponse\"\x00(\x010\x01\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xE7\x03\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0CSessionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAA\xD1\x02\x0A!dialogflow.googleapis.com/Session\x12+projects/{project}/agent/sessions/{session}\x12Sprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}\x12@projects/{project}/locations/{location}/agent/sessions/{session}\x12hprojects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SessionEntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SessionEntityType.php new file mode 100644 index 000000000000..6dfbf8324314 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SessionEntityType.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + "\x0A\x97%\x0A4google/cloud/dialogflow/v2/session_entity_type.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A,google/cloud/dialogflow/v2/entity_type.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\"\xA1\x06\x0A\x11SessionEntityType\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12c\x0A\x14entity_override_mode\x18\x02 \x01(\x0E2@.google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideModeB\x03\xE0A\x02\x12D\x0A\x08entities\x18\x03 \x03(\x0B2-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xE0A\x02\"\x82\x01\x0A\x12EntityOverrideMode\x12\$\x0A ENTITY_OVERRIDE_MODE_UNSPECIFIED\x10\x00\x12!\x0A\x1DENTITY_OVERRIDE_MODE_OVERRIDE\x10\x01\x12#\x0A\x1FENTITY_OVERRIDE_MODE_SUPPLEMENT\x10\x02:\xC8\x03\xEAA\xC4\x03\x0A+dialogflow.googleapis.com/SessionEntityType\x12Eprojects/{project}/agent/sessions/{session}/entityTypes/{entity_type}\x12mprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}\x12Zprojects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}\x12\x82\x01projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}\"\x95\x01\x0A\x1DListSessionEntityTypesRequest\x12C\x0A\x06parent\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x12+dialogflow.googleapis.com/SessionEntityType\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"\x86\x01\x0A\x1EListSessionEntityTypesResponse\x12K\x0A\x14session_entity_types\x18\x01 \x03(\x0B2-.google.cloud.dialogflow.v2.SessionEntityType\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"`\x0A\x1BGetSessionEntityTypeRequest\x12A\x0A\x04name\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x0A+dialogflow.googleapis.com/SessionEntityType\"\xB6\x01\x0A\x1ECreateSessionEntityTypeRequest\x12C\x0A\x06parent\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x12+dialogflow.googleapis.com/SessionEntityType\x12O\x0A\x13session_entity_type\x18\x02 \x01(\x0B2-.google.cloud.dialogflow.v2.SessionEntityTypeB\x03\xE0A\x02\"\xA7\x01\x0A\x1EUpdateSessionEntityTypeRequest\x12O\x0A\x13session_entity_type\x18\x01 \x01(\x0B2-.google.cloud.dialogflow.v2.SessionEntityTypeB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"c\x0A\x1EDeleteSessionEntityTypeRequest\x12A\x0A\x04name\x18\x01 \x01(\x09B3\xE0A\x02\xFAA-\x0A+dialogflow.googleapis.com/SessionEntityType2\xEA\x14\x0A\x12SessionEntityTypes\x12\xC6\x03\x0A\x16ListSessionEntityTypes\x129.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest\x1A:.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse\"\xB4\x02\xDAA\x06parent\x82\xD3\xE4\x93\x02\xA4\x02\x124/v2/{parent=projects/*/agent/sessions/*}/entityTypesZM\x12K/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypesZB\x12@/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypesZY\x12W/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes\x12\xB3\x03\x0A\x14GetSessionEntityType\x127.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest\x1A-.google.cloud.dialogflow.v2.SessionEntityType\"\xB2\x02\xDAA\x04name\x82\xD3\xE4\x93\x02\xA4\x02\x124/v2/{name=projects/*/agent/sessions/*/entityTypes/*}ZM\x12K/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}ZB\x12@/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}ZY\x12W/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}\x12\xA3\x04\x0A\x17CreateSessionEntityType\x12:.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest\x1A-.google.cloud.dialogflow.v2.SessionEntityType\"\x9C\x03\xDAA\x1Aparent,session_entity_type\x82\xD3\xE4\x93\x02\xF8\x02\"4/v2/{parent=projects/*/agent/sessions/*}/entityTypes:\x13session_entity_typeZb\"K/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes:\x13session_entity_typeZW\"@/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes:\x13session_entity_typeZn\"W/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes:\x13session_entity_type\x12\x8F\x05\x0A\x17UpdateSessionEntityType\x12:.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest\x1A-.google.cloud.dialogflow.v2.SessionEntityType\"\x88\x04\xDAA\x13session_entity_type\xDAA\x1Fsession_entity_type,update_mask\x82\xD3\xE4\x93\x02\xC9\x032H/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}:\x13session_entity_typeZv2_/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}:\x13session_entity_typeZk2T/v2/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}:\x13session_entity_typeZ\x82\x012k/v2/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}:\x13session_entity_type\x12\xA2\x03\x0A\x17DeleteSessionEntityType\x12:.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest\x1A\x16.google.protobuf.Empty\"\xB2\x02\xDAA\x04name\x82\xD3\xE4\x93\x02\xA4\x02*4/v2/{name=projects/*/agent/sessions/*/entityTypes/*}ZM*K/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}ZB*@/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}ZY*W/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9C\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x16SessionEntityTypeProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SipTrunk.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SipTrunk.php new file mode 100644 index 000000000000..b69ea979e11c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SipTrunk.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + "\x0A\xEF\x19\x0A*google/cloud/dialogflow/v2/sip_trunk.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x91\x01\x0A\x15CreateSipTrunkRequest\x12:\x0A\x06parent\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x12\"dialogflow.googleapis.com/SipTrunk\x12<\x0A\x09sip_trunk\x18\x02 \x01(\x0B2\$.google.cloud.dialogflow.v2.SipTrunkB\x03\xE0A\x02\"Q\x0A\x15DeleteSipTrunkRequest\x128\x0A\x04name\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/SipTrunk\"\x83\x01\x0A\x14ListSipTrunksRequest\x12:\x0A\x06parent\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x12\"dialogflow.googleapis.com/SipTrunk\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"j\x0A\x15ListSipTrunksResponse\x128\x0A\x0Asip_trunks\x18\x01 \x03(\x0B2\$.google.cloud.dialogflow.v2.SipTrunk\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"N\x0A\x12GetSipTrunkRequest\x128\x0A\x04name\x18\x01 \x01(\x09B*\xE0A\x02\xFAA\$\x0A\"dialogflow.googleapis.com/SipTrunk\"\x8B\x01\x0A\x15UpdateSipTrunkRequest\x12<\x0A\x09sip_trunk\x18\x01 \x01(\x0B2\$.google.cloud.dialogflow.v2.SipTrunkB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"\x96\x02\x0A\x08SipTrunk\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x1E\x0A\x11expected_hostname\x18\x02 \x03(\x09B\x03\xE0A\x02\x12@\x0A\x0Bconnections\x18\x03 \x03(\x0B2&.google.cloud.dialogflow.v2.ConnectionB\x03\xE0A\x03\x12\x19\x0A\x0Cdisplay_name\x18\x04 \x01(\x09B\x03\xE0A\x01:z\xEAAw\x0A\"dialogflow.googleapis.com/SipTrunk\x12\xDAA\x06parent\x82\xD3\xE4\x93\x02/\x12-/v2/{parent=projects/*/locations/*}/sipTrunks\x12\xA1\x01\x0A\x0BGetSipTrunk\x12..google.cloud.dialogflow.v2.GetSipTrunkRequest\x1A\$.google.cloud.dialogflow.v2.SipTrunk\"<\xDAA\x04name\x82\xD3\xE4\x93\x02/\x12-/v2/{name=projects/*/locations/*/sipTrunks/*}\x12\xCD\x01\x0A\x0EUpdateSipTrunk\x121.google.cloud.dialogflow.v2.UpdateSipTrunkRequest\x1A\$.google.cloud.dialogflow.v2.SipTrunk\"b\xDAA\x15sip_trunk,update_mask\x82\xD3\xE4\x93\x02D27/v2/{sip_trunk.name=projects/*/locations/*/sipTrunks/*}:\x09sip_trunk\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x93\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0DSipTrunkProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Tool.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Tool.php new file mode 100644 index 000000000000..706a690b018b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Tool.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + "\x0A\xFF/\x0A%google/cloud/dialogflow/v2/tool.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x96\x01\x0A\x11CreateToolRequest\x126\x0A\x06parent\x18\x01 \x01(\x09B&\xE0A\x02\xFAA \x12\x1Edialogflow.googleapis.com/Tool\x123\x0A\x04tool\x18\x02 \x01(\x0B2 .google.cloud.dialogflow.v2.ToolB\x03\xE0A\x02\x12\x14\x0A\x07tool_id\x18\x03 \x01(\x09B\x03\xE0A\x01\"F\x0A\x0EGetToolRequest\x124\x0A\x04name\x18\x01 \x01(\x09B&\xE0A\x02\xFAA \x0A\x1Edialogflow.googleapis.com/Tool\"{\x0A\x10ListToolsRequest\x126\x0A\x06parent\x18\x01 \x01(\x09B&\xE0A\x02\xFAA \x12\x1Edialogflow.googleapis.com/Tool\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"]\x0A\x11ListToolsResponse\x12/\x0A\x05tools\x18\x01 \x03(\x0B2 .google.cloud.dialogflow.v2.Tool\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"I\x0A\x11DeleteToolRequest\x124\x0A\x04name\x18\x01 \x01(\x09B&\xE0A\x02\xFAA \x0A\x1Edialogflow.googleapis.com/Tool\"~\x0A\x11UpdateToolRequest\x123\x0A\x04tool\x18\x01 \x01(\x0B2 .google.cloud.dialogflow.v2.ToolB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"\xAE\x1F\x0A\x04Tool\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x08\xE0A\x03\x12\x15\x0A\x08tool_key\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x19\x0A\x0Cdisplay_name\x18\x13 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x03 \x01(\x09B\x03\xE0A\x01\x12q\x0A\x1Faction_confirmation_requirement\x18\x11 \x03(\x0B2C.google.cloud.dialogflow.v2.Tool.ActionConfirmationRequirementEntryB\x03\xE0A\x01\x12L\x0A\x0Eextension_spec\x18\x04 \x01(\x0B2..google.cloud.dialogflow.v2.Tool.ExtensionToolB\x02\x18\x01H\x00\x12F\x0A\x0Dfunction_spec\x18\x0D \x01(\x0B2-.google.cloud.dialogflow.v2.Tool.FunctionToolH\x00\x12H\x0A\x0Econnector_spec\x18\x12 \x01(\x0B2..google.cloud.dialogflow.v2.Tool.ConnectorToolH\x00\x12E\x0A\x0Dopen_api_spec\x18\x14 \x01(\x0B2,.google.cloud.dialogflow.v2.Tool.OpenApiToolH\x00\x124\x0A\x0Bcreate_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x06 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x1F\x0A\x0Dsatisfies_pzs\x18\x0E \x01(\x08B\x03\xE0A\x03H\x01\x88\x01\x01\x12\x1F\x0A\x0Dsatisfies_pzi\x18\x0F \x01(\x08B\x03\xE0A\x03H\x02\x88\x01\x01\x1A\"\x0A\x0DExtensionTool\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x1A\xBE\x01\x0A\x0CFunctionTool\x122\x0A\x0Cinput_schema\x18\x01 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x123\x0A\x0Doutput_schema\x18\x02 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x12E\x0A\x0Bmethod_type\x18\x04 \x01(\x0E2+.google.cloud.dialogflow.v2.Tool.MethodTypeB\x03\xE0A\x01\x1A\xA6\x02\x0A\x0BOpenApiTool\x12\x1A\x0A\x0Btext_schema\x18\x01 \x01(\x09B\x03\xE0A\x02H\x00\x12L\x0A\x0Eauthentication\x18\x02 \x01(\x0B2/.google.cloud.dialogflow.v2.Tool.AuthenticationB\x03\xE0A\x01\x12C\x0A\x0Atls_config\x18\x03 \x01(\x0B2*.google.cloud.dialogflow.v2.Tool.TLSConfigB\x03\xE0A\x01\x12^\x0A\x18service_directory_config\x18\x04 \x01(\x0B27.google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfigB\x03\xE0A\x01B\x08\x0A\x06schema\x1A\xC4\x04\x0A\x0DConnectorTool\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12K\x0A\x07actions\x18\x02 \x03(\x0B25.google.cloud.dialogflow.v2.Tool.ConnectorTool.ActionB\x03\xE0A\x02\x1A\xD2\x03\x0A\x06Action\x12\x1E\x0A\x14connection_action_id\x18\x04 \x01(\x09H\x00\x12a\x0A\x10entity_operation\x18\x05 \x01(\x0B2E.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperationH\x00\x12\x19\x0A\x0Cinput_fields\x18\x02 \x03(\x09B\x03\xE0A\x01\x12\x1A\x0A\x0Doutput_fields\x18\x03 \x03(\x09B\x03\xE0A\x01\x1A\xFE\x01\x0A\x0FEntityOperation\x12\x16\x0A\x09entity_id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12k\x0A\x09operation\x18\x02 \x01(\x0E2S.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationTypeB\x03\xE0A\x02\"f\x0A\x0DOperationType\x12\x1E\x0A\x1AOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\x0A\x04LIST\x10\x01\x12\x07\x0A\x03GET\x10\x02\x12\x0A\x0A\x06CREATE\x10\x03\x12\x0A\x0A\x06UPDATE\x10\x04\x12\x0A\x0A\x06DELETE\x10\x05B\x0D\x0A\x0Baction_spec\x1A\xDA\x0B\x0A\x0EAuthentication\x12V\x0A\x0Eapi_key_config\x18\x01 \x01(\x0B2<.google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfigH\x00\x12S\x0A\x0Coauth_config\x18\x02 \x01(\x0B2;.google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfigH\x00\x12k\x0A\x19service_agent_auth_config\x18\x03 \x01(\x0B2F.google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfigH\x00\x12`\x0A\x13bearer_token_config\x18\x04 \x01(\x0B2A.google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfigH\x00\x1A\xF3\x01\x0A\x0CApiKeyConfig\x12\x15\x0A\x08key_name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x14\x0A\x07api_key\x18\x02 \x01(\x09B\x03\xE0A\x01\x12V\x0A\x1Asecret_version_for_api_key\x18\x04 \x01(\x09B2\xE0A\x01\xFAA,\x0A*secretmanager.googleapis.com/SecretVersion\x12^\x0A\x10request_location\x18\x03 \x01(\x0E2?.google.cloud.dialogflow.v2.Tool.Authentication.RequestLocationB\x03\xE0A\x02\x1A\x87\x03\x0A\x0BOAuthConfig\x12i\x0A\x10oauth_grant_type\x18\x01 \x01(\x0E2J.google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantTypeB\x03\xE0A\x02\x12\x16\x0A\x09client_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dclient_secret\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\\\x0A secret_version_for_client_secret\x18\x06 \x01(\x09B2\xE0A\x01\xFAA,\x0A*secretmanager.googleapis.com/SecretVersion\x12\x1B\x0A\x0Etoken_endpoint\x18\x04 \x01(\x09B\x03\xE0A\x02\x12\x13\x0A\x06scopes\x18\x05 \x03(\x09B\x03\xE0A\x01\"I\x0A\x0EOauthGrantType\x12 \x0A\x1COAUTH_GRANT_TYPE_UNSPECIFIED\x10\x00\x12\x15\x0A\x11CLIENT_CREDENTIAL\x10\x01\x1A\xEA\x01\x0A\x16ServiceAgentAuthConfig\x12x\x0A\x12service_agent_auth\x18\x01 \x01(\x0E2W.google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuthB\x03\xE0A\x01\"V\x0A\x10ServiceAgentAuth\x12\"\x0A\x1ESERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08ID_TOKEN\x10\x01\x12\x10\x0A\x0CACCESS_TOKEN\x10\x02\x1A}\x0A\x11BearerTokenConfig\x12\x12\x0A\x05token\x18\x01 \x01(\x09B\x03\xE0A\x01\x12T\x0A\x18secret_version_for_token\x18\x02 \x01(\x09B2\xE0A\x01\xFAA,\x0A*secretmanager.googleapis.com/SecretVersion\"Q\x0A\x0FRequestLocation\x12 \x0A\x1CREQUEST_LOCATION_UNSPECIFIED\x10\x00\x12\x0A\x0A\x06HEADER\x10\x01\x12\x10\x0A\x0CQUERY_STRING\x10\x02B\x0D\x0A\x0Bauth_config\x1A\x8D\x01\x0A\x09TLSConfig\x12H\x0A\x08ca_certs\x18\x01 \x03(\x0B21.google.cloud.dialogflow.v2.Tool.TLSConfig.CACertB\x03\xE0A\x02\x1A6\x0A\x06CACert\x12\x19\x0A\x0Cdisplay_name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04cert\x18\x02 \x01(\x0CB\x03\xE0A\x02\x1AZ\x0A\x16ServiceDirectoryConfig\x12@\x0A\x07service\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x0A'servicedirectory.googleapis.com/Service\x1A~\x0A\"ActionConfirmationRequirementEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12G\x0A\x05value\x18\x02 \x01(\x0E28.google.cloud.dialogflow.v2.Tool.ConfirmationRequirement:\x028\x01\"c\x0A\x17ConfirmationRequirement\x12(\x0A\$CONFIRMATION_REQUIREMENT_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08REQUIRED\x10\x01\x12\x10\x0A\x0CNOT_REQUIRED\x10\x02\"\\\x0A\x0AMethodType\x12\x1B\x0A\x17METHOD_TYPE_UNSPECIFIED\x10\x00\x12\x07\x0A\x03GET\x10\x01\x12\x08\x0A\x04POST\x10\x02\x12\x07\x0A\x03PUT\x10\x03\x12\x0A\x0A\x06DELETE\x10\x04\x12\x09\x0A\x05PATCH\x10\x05:f\xEAAc\x0A\x1Edialogflow.googleapis.com/Tool\x124projects/{project}/locations/{location}/tools/{tool}*\x05tools2\x04toolB\x0F\x0A\x0DspecificationB\x10\x0A\x0E_satisfies_pzsB\x10\x0A\x0E_satisfies_pzi2\xAC\x07\x0A\x05Tools\x12\xAC\x01\x0A\x0ACreateTool\x12-.google.cloud.dialogflow.v2.CreateToolRequest\x1A .google.cloud.dialogflow.v2.Tool\"M\xDAA\x13parent,tool,tool_id\x82\xD3\xE4\x93\x021\")/v2/{parent=projects/*/locations/*}/tools:\x04tool\x12\x91\x01\x0A\x07GetTool\x12*.google.cloud.dialogflow.v2.GetToolRequest\x1A .google.cloud.dialogflow.v2.Tool\"8\xDAA\x04name\x82\xD3\xE4\x93\x02+\x12)/v2/{name=projects/*/locations/*/tools/*}\x12\xA4\x01\x0A\x09ListTools\x12,.google.cloud.dialogflow.v2.ListToolsRequest\x1A-.google.cloud.dialogflow.v2.ListToolsResponse\":\xDAA\x06parent\x82\xD3\xE4\x93\x02+\x12)/v2/{parent=projects/*/locations/*}/tools\x12\x8D\x01\x0A\x0ADeleteTool\x12-.google.cloud.dialogflow.v2.DeleteToolRequest\x1A\x16.google.protobuf.Empty\"8\xDAA\x04name\x82\xD3\xE4\x93\x02+*)/v2/{name=projects/*/locations/*/tools/*}\x12\xAE\x01\x0A\x0AUpdateTool\x12-.google.cloud.dialogflow.v2.UpdateToolRequest\x1A .google.cloud.dialogflow.v2.Tool\"O\xDAA\x10tool,update_mask\x82\xD3\xE4\x93\x0262./v2/{tool.name=projects/*/locations/*/tools/*}:\x04tool\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xF6\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x09ToolProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAAd\x0A*secretmanager.googleapis.com/SecretVersion\x126projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ToolCall.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ToolCall.php new file mode 100644 index 000000000000..b7d6c738c7e2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ToolCall.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\x90\x0B\x0A*google/cloud/dialogflow/v2/tool_call.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xD8\x04\x0A\x08ToolCall\x126\x0A\x04tool\x18\x01 \x01(\x09B&\xE0A\x01\xFAA \x0A\x1Edialogflow.googleapis.com/ToolH\x00\x123\x0A\x08ces_tool\x18\x0B \x01(\x09B\x1F\xE0A\x01\xFAA\x19\x0A\x17ces.googleapis.com/ToolH\x00\x129\x0A\x0Bces_toolset\x18\x0C \x01(\x09B\"\xE0A\x01\xFAA\x1C\x0A\x1Aces.googleapis.com/ToolsetH\x00\x121\x0A\x07ces_app\x18\x08 \x01(\x09B\x1E\xE0A\x01\xFAA\x18\x0A\x16ces.googleapis.com/AppH\x00\x12\x1E\x0A\x11tool_display_name\x18\x09 \x01(\x09B\x03\xE0A\x01\x12!\x0A\x14tool_display_details\x18\x0A \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06action\x18\x02 \x01(\x09B\x03\xE0A\x01\x126\x0A\x10input_parameters\x18\x03 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x1A\x0A\x0Danswer_record\x18\x06 \x01(\x09B\x03\xE0A\x01\x12>\x0A\x05state\x18\x07 \x01(\x0E2*.google.cloud.dialogflow.v2.ToolCall.StateB\x03\xE0A\x03\"E\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0D\x0A\x09TRIGGERED\x10\x01\x12\x16\x0A\x12NEEDS_CONFIRMATION\x10\x02B\x08\x0A\x06source\"\xF2\x03\x0A\x0EToolCallResult\x126\x0A\x04tool\x18\x01 \x01(\x09B&\xE0A\x01\xFAA \x0A\x1Edialogflow.googleapis.com/ToolH\x00\x129\x0A\x0Bces_toolset\x18\x0D \x01(\x09B\"\xE0A\x01\xFAA\x1C\x0A\x1Aces.googleapis.com/ToolsetH\x00\x123\x0A\x08ces_tool\x18\x0C \x01(\x09B\x1F\xE0A\x01\xFAA\x19\x0A\x17ces.googleapis.com/ToolH\x00\x121\x0A\x07ces_app\x18\x0B \x01(\x09B\x1E\xE0A\x01\xFAA\x18\x0A\x16ces.googleapis.com/AppH\x00\x12\x13\x0A\x06action\x18\x02 \x01(\x09B\x03\xE0A\x01\x12A\x0A\x05error\x18\x03 \x01(\x0B20.google.cloud.dialogflow.v2.ToolCallResult.ErrorH\x01\x12\x15\x0A\x0Braw_content\x18\x05 \x01(\x0CH\x01\x12\x11\x0A\x07content\x18\x06 \x01(\x09H\x01\x124\x0A\x0Bcreate_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x1A\x0A\x0Danswer_record\x18\x09 \x01(\x09B\x03\xE0A\x01\x1A\x1D\x0A\x05Error\x12\x14\x0A\x07message\x18\x01 \x01(\x09B\x03\xE0A\x01B\x08\x0A\x06sourceB\x08\x0A\x06resultB\x93\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0DToolCallProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Toolset.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Toolset.php new file mode 100644 index 000000000000..fae372e45820 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Toolset.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + "\x0A\xCC\x04\x0A(google/cloud/dialogflow/v2/toolset.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x19google/api/resource.proto\x1A%google/cloud/dialogflow/v2/tool.proto\"\xBE\x01\x0A\x0BToolsetTool\x123\x0A\x07toolset\x18\x01 \x01(\x09B\"\xE0A\x02\xFAA\x1C\x0A\x1Aces.googleapis.com/Toolset\x12\x19\x0A\x0Coperation_id\x18\x02 \x01(\x09B\x03\xE0A\x01\x12_\x0A\x18confirmation_requirement\x18\x03 \x01(\x0E28.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xE0A\x01B\xF8\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0CToolsetProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAAc\x0A\x1Aces.googleapis.com/Toolset\x12Eprojects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ValidationResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ValidationResult.php new file mode 100644 index 000000000000..2e81f3cbe763 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ValidationResult.php @@ -0,0 +1,24 @@ +internalAddGeneratedFile( + "\x0A\xAC\x04\x0A2google/cloud/dialogflow/v2/validation_result.proto\x12\x1Agoogle.cloud.dialogflow.v2\"\xD7\x01\x0A\x0FValidationError\x12F\x0A\x08severity\x18\x01 \x01(\x0E24.google.cloud.dialogflow.v2.ValidationError.Severity\x12\x0F\x0A\x07entries\x18\x03 \x03(\x09\x12\x15\x0A\x0Derror_message\x18\x04 \x01(\x09\"T\x0A\x08Severity\x12\x18\x0A\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x08\x0A\x04INFO\x10\x01\x12\x0B\x0A\x07WARNING\x10\x02\x12\x09\x0A\x05ERROR\x10\x03\x12\x0C\x0A\x08CRITICAL\x10\x04\"Z\x0A\x10ValidationResult\x12F\x0A\x11validation_errors\x18\x01 \x03(\x0B2+.google.cloud.dialogflow.v2.ValidationErrorB\x9B\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x15ValidationResultProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Version.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Version.php new file mode 100644 index 000000000000..6b776ce0e4d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Version.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + "\x0A\x81\x16\x0A(google/cloud/dialogflow/v2/version.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xC3\x03\x0A\x07Version\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x1B\x0A\x0Eversion_number\x18\x03 \x01(\x05B\x03\xE0A\x03\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12F\x0A\x06status\x18\x06 \x01(\x0E21.google.cloud.dialogflow.v2.Version.VersionStatusB\x03\xE0A\x03\"W\x0A\x0DVersionStatus\x12\x1E\x0A\x1AVERSION_STATUS_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BIN_PROGRESS\x10\x01\x12\x09\x0A\x05READY\x10\x02\x12\x0A\x0A\x06FAILED\x10\x03:\x96\x01\xEAA\x92\x01\x0A!dialogflow.googleapis.com/Version\x12+projects/{project}/agent/versions/{version}\x12@projects/{project}/locations/{location}/agent/versions/{version}\"\x81\x01\x0A\x13ListVersionsRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!dialogflow.googleapis.com/Version\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\"f\x0A\x14ListVersionsResponse\x125\x0A\x08versions\x18\x01 \x03(\x0B2#.google.cloud.dialogflow.v2.Version\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"L\x0A\x11GetVersionRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!dialogflow.googleapis.com/Version\"\x8C\x01\x0A\x14CreateVersionRequest\x129\x0A\x06parent\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x12!dialogflow.googleapis.com/Version\x129\x0A\x07version\x18\x02 \x01(\x0B2#.google.cloud.dialogflow.v2.VersionB\x03\xE0A\x02\"\x87\x01\x0A\x14UpdateVersionRequest\x129\x0A\x07version\x18\x01 \x01(\x0B2#.google.cloud.dialogflow.v2.VersionB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\"O\x0A\x14DeleteVersionRequest\x127\x0A\x04name\x18\x01 \x01(\x09B)\xE0A\x02\xFAA#\x0A!dialogflow.googleapis.com/Version2\xFC\x09\x0A\x08Versions\x12\xE0\x01\x0A\x0CListVersions\x12/.google.cloud.dialogflow.v2.ListVersionsRequest\x1A0.google.cloud.dialogflow.v2.ListVersionsResponse\"m\xDAA\x06parent\x82\xD3\xE4\x93\x02^\x12&/v2/{parent=projects/*/agent}/versionsZ4\x122/v2/{parent=projects/*/locations/*/agent}/versions\x12\xCD\x01\x0A\x0AGetVersion\x12-.google.cloud.dialogflow.v2.GetVersionRequest\x1A#.google.cloud.dialogflow.v2.Version\"k\xDAA\x04name\x82\xD3\xE4\x93\x02^\x12&/v2/{name=projects/*/agent/versions/*}Z4\x122/v2/{name=projects/*/locations/*/agent/versions/*}\x12\xF0\x01\x0A\x0DCreateVersion\x120.google.cloud.dialogflow.v2.CreateVersionRequest\x1A#.google.cloud.dialogflow.v2.Version\"\x87\x01\xDAA\x0Eparent,version\x82\xD3\xE4\x93\x02p\"&/v2/{parent=projects/*/agent}/versions:\x07versionZ=\"2/v2/{parent=projects/*/locations/*/agent}/versions:\x07version\x12\x86\x02\x0A\x0DUpdateVersion\x120.google.cloud.dialogflow.v2.UpdateVersionRequest\x1A#.google.cloud.dialogflow.v2.Version\"\x9D\x01\xDAA\x13version,update_mask\x82\xD3\xE4\x93\x02\x80\x012./v2/{version.name=projects/*/agent/versions/*}:\x07versionZE2:/v2/{version.name=projects/*/locations/*/agent/versions/*}:\x07version\x12\xC6\x01\x0A\x0DDeleteVersion\x120.google.cloud.dialogflow.v2.DeleteVersionRequest\x1A\x16.google.protobuf.Empty\"k\xDAA\x04name\x82\xD3\xE4\x93\x02^*&/v2/{name=projects/*/agent/versions/*}Z4*2/v2/{name=projects/*/locations/*/agent/versions/*}\x1Ax\xCAA\x19dialogflow.googleapis.com\xD2AYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x92\x01\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0CVersionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Webhook.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Webhook.php new file mode 100644 index 000000000000..c21c48422dc6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Webhook.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + "\x0A\xF9\x09\x0A(google/cloud/dialogflow/v2/webhook.proto\x12\x1Agoogle.cloud.dialogflow.v2\x1A(google/cloud/dialogflow/v2/context.proto\x1A'google/cloud/dialogflow/v2/intent.proto\x1A(google/cloud/dialogflow/v2/session.proto\x1A4google/cloud/dialogflow/v2/session_entity_type.proto\x1A\x1Cgoogle/protobuf/struct.proto\"\xD6\x01\x0A\x0EWebhookRequest\x12\x0F\x0A\x07session\x18\x04 \x01(\x09\x12\x13\x0A\x0Bresponse_id\x18\x01 \x01(\x09\x12=\x0A\x0Cquery_result\x18\x02 \x01(\x0B2'.google.cloud.dialogflow.v2.QueryResult\x12_\x0A\x1Eoriginal_detect_intent_request\x18\x03 \x01(\x0B27.google.cloud.dialogflow.v2.OriginalDetectIntentRequest\"\x80\x03\x0A\x0FWebhookResponse\x12\x18\x0A\x10fulfillment_text\x18\x01 \x01(\x09\x12H\x0A\x14fulfillment_messages\x18\x02 \x03(\x0B2*.google.cloud.dialogflow.v2.Intent.Message\x12\x0E\x0A\x06source\x18\x03 \x01(\x09\x12(\x0A\x07payload\x18\x04 \x01(\x0B2\x17.google.protobuf.Struct\x12<\x0A\x0Foutput_contexts\x18\x05 \x03(\x0B2#.google.cloud.dialogflow.v2.Context\x12D\x0A\x14followup_event_input\x18\x06 \x01(\x0B2&.google.cloud.dialogflow.v2.EventInput\x12K\x0A\x14session_entity_types\x18\x0A \x03(\x0B2-.google.cloud.dialogflow.v2.SessionEntityType\"h\x0A\x1BOriginalDetectIntentRequest\x12\x0E\x0A\x06source\x18\x01 \x01(\x09\x12\x0F\x0A\x07version\x18\x02 \x01(\x09\x12(\x0A\x07payload\x18\x03 \x01(\x0B2\x17.google.protobuf.StructB\x91\x02\x0A\x1Ecom.google.cloud.dialogflow.v2B\x0CWebhookProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xA2\x02\x02DF\xAA\x02\x1AGoogle.Cloud.Dialogflow.V2\xEAA|\x0A'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php new file mode 100644 index 000000000000..92fb47549853 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php @@ -0,0 +1,543 @@ +google.cloud.dialogflow.v2.Agent + */ +class Agent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project of this agent. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of this agent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * + * Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $default_language_code = ''; + /** + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * + * Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $supported_language_codes; + /** + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $time_zone = ''; + /** + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * + * Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $avatar_uri = ''; + /** + * Optional. Determines whether this agent should log conversation queries. + * + * Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_logging = false; + /** + * Optional. Determines how intents are detected from user queries. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $match_mode = 0; + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * + * Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $classification_threshold = 0.0; + /** + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $api_version = 0; + /** + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tier = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project of this agent. + * Format: `projects/`. + * @type string $display_name + * Required. The name of this agent. + * @type string $default_language_code + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * @type string[] $supported_language_codes + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * @type string $time_zone + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * @type string $description + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * @type string $avatar_uri + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * @type bool $enable_logging + * Optional. Determines whether this agent should log conversation queries. + * @type int $match_mode + * Optional. Determines how intents are detected from user queries. + * @type float $classification_threshold + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * @type int $api_version + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * @type int $tier + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project of this agent. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project of this agent. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of this agent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of this agent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * + * Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDefaultLanguageCode() + { + return $this->default_language_code; + } + + /** + * Required. The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * + * Generated from protobuf field string default_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDefaultLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->default_language_code = $var; + + return $this; + } + + /** + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * + * Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getSupportedLanguageCodes() + { + return $this->supported_language_codes; + } + + /** + * Optional. The list of all languages supported by this agent (except for the + * `default_language_code`). + * + * Generated from protobuf field repeated string supported_language_codes = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setSupportedLanguageCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->supported_language_codes = $arr; + + return $this; + } + + /** + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Required. The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of this agent. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * + * Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAvatarUri() + { + return $this->avatar_uri; + } + + /** + * Optional. The URI of the agent's avatar. + * Avatars are used throughout the Dialogflow console and in the self-hosted + * [Web + * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + * integration. + * + * Generated from protobuf field string avatar_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAvatarUri($var) + { + GPBUtil::checkString($var, True); + $this->avatar_uri = $var; + + return $this; + } + + /** + * Optional. Determines whether this agent should log conversation queries. + * + * Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableLogging() + { + return $this->enable_logging; + } + + /** + * Optional. Determines whether this agent should log conversation queries. + * + * Generated from protobuf field bool enable_logging = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableLogging($var) + { + GPBUtil::checkBool($var); + $this->enable_logging = $var; + + return $this; + } + + /** + * Optional. Determines how intents are detected from user queries. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return int + * @deprecated + */ + public function getMatchMode() + { + if ($this->match_mode !== 0) { + @trigger_error('match_mode is deprecated.', E_USER_DEPRECATED); + } + return $this->match_mode; + } + + /** + * Optional. Determines how intents are detected from user queries. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.MatchMode match_mode = 9 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + * @deprecated + */ + public function setMatchMode($var) + { + @trigger_error('match_mode is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent\MatchMode::class); + $this->match_mode = $var; + + return $this; + } + + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * + * Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getClassificationThreshold() + { + return $this->classification_threshold; + } + + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less than + * the threshold value, then a fallback intent will be triggered or, if there + * are no fallback intents defined, no intent will be triggered. The score + * values range from 0.0 (completely uncertain) to 1.0 (completely certain). + * If set to 0.0, the default of 0.3 is used. + * + * Generated from protobuf field float classification_threshold = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setClassificationThreshold($var) + { + GPBUtil::checkFloat($var); + $this->classification_threshold = $var; + + return $this; + } + + /** + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Optional. API version displayed in Dialogflow console. If not specified, + * V2 API is assumed. Clients are free to query different service endpoints + * for different API versions. However, bots connectors and webhook calls will + * follow the specified API version. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.ApiVersion api_version = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent\ApiVersion::class); + $this->api_version = $var; + + return $this; + } + + /** + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTier() + { + return $this->tier; + } + + /** + * Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent.Tier tier = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Agent\Tier::class); + $this->tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php new file mode 100644 index 000000000000..95c0a671ca15 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Agent.ApiVersion + */ +class ApiVersion +{ + /** + * Not specified. + * + * Generated from protobuf enum API_VERSION_UNSPECIFIED = 0; + */ + const API_VERSION_UNSPECIFIED = 0; + /** + * Legacy V1 API. + * + * Generated from protobuf enum API_VERSION_V1 = 1; + */ + const API_VERSION_V1 = 1; + /** + * V2 API. + * + * Generated from protobuf enum API_VERSION_V2 = 2; + */ + const API_VERSION_V2 = 2; + /** + * V2beta1 API. + * + * Generated from protobuf enum API_VERSION_V2_BETA_1 = 3; + */ + const API_VERSION_V2_BETA_1 = 3; + + private static $valueToName = [ + self::API_VERSION_UNSPECIFIED => 'API_VERSION_UNSPECIFIED', + self::API_VERSION_V1 => 'API_VERSION_V1', + self::API_VERSION_V2 => 'API_VERSION_V2', + self::API_VERSION_V2_BETA_1 => 'API_VERSION_V2_BETA_1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php new file mode 100644 index 000000000000..9edec7414a91 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php @@ -0,0 +1,63 @@ +google.cloud.dialogflow.v2.Agent.MatchMode + */ +class MatchMode +{ + /** + * Not specified. + * + * Generated from protobuf enum MATCH_MODE_UNSPECIFIED = 0; + */ + const MATCH_MODE_UNSPECIFIED = 0; + /** + * Best for agents with a small number of examples in intents and/or wide + * use of templates syntax and composite entities. + * + * Generated from protobuf enum MATCH_MODE_HYBRID = 1; + */ + const MATCH_MODE_HYBRID = 1; + /** + * Can be used for agents with a large number of examples in intents, + * especially the ones using \@sys.any or very large custom entities. + * + * Generated from protobuf enum MATCH_MODE_ML_ONLY = 2; + */ + const MATCH_MODE_ML_ONLY = 2; + + private static $valueToName = [ + self::MATCH_MODE_UNSPECIFIED => 'MATCH_MODE_UNSPECIFIED', + self::MATCH_MODE_HYBRID => 'MATCH_MODE_HYBRID', + self::MATCH_MODE_ML_ONLY => 'MATCH_MODE_ML_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php new file mode 100644 index 000000000000..600b491dc42e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Agent.Tier + */ +class Tier +{ + /** + * Not specified. This value should never be used. + * + * Generated from protobuf enum TIER_UNSPECIFIED = 0; + */ + const TIER_UNSPECIFIED = 0; + /** + * Trial Edition, previously known as Standard Edition. + * + * Generated from protobuf enum TIER_STANDARD = 1; + */ + const TIER_STANDARD = 1; + /** + * Essentials Edition, previously known as Enterprise Essential Edition. + * + * Generated from protobuf enum TIER_ENTERPRISE = 2; + */ + const TIER_ENTERPRISE = 2; + /** + * Essentials Edition (same as TIER_ENTERPRISE), previously known as + * Enterprise Plus Edition. + * + * Generated from protobuf enum TIER_ENTERPRISE_PLUS = 3 [deprecated = true]; + */ + const TIER_ENTERPRISE_PLUS = 3; + + private static $valueToName = [ + self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', + self::TIER_STANDARD => 'TIER_STANDARD', + self::TIER_ENTERPRISE => 'TIER_ENTERPRISE', + self::TIER_ENTERPRISE_PLUS => 'TIER_ENTERPRISE_PLUS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php new file mode 100644 index 000000000000..3b6eecac7c71 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php @@ -0,0 +1,331 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback + */ +class AgentAssistantFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $answer_relevance = 0; + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_correctness = 0; + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_efficiency = 0; + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $summarization_feedback = null; + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $knowledge_search_feedback = null; + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $knowledge_assist_feedback = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $answer_relevance + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * @type int $document_correctness + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * @type int $document_efficiency + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback $summarization_feedback + * Optional. Feedback for conversation summarization. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $knowledge_search_feedback + * Optional. Feedback for knowledge search. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $knowledge_assist_feedback + * Optional. Feedback for knowledge assist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAnswerRelevance() + { + return $this->answer_relevance; + } + + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAnswerRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\AnswerRelevance::class); + $this->answer_relevance = $var; + + return $this; + } + + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDocumentCorrectness() + { + return $this->document_correctness; + } + + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_correctness]: [INCORRECT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness.INCORRECT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDocumentCorrectness($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\DocumentCorrectness::class); + $this->document_correctness = $var; + + return $this; + } + + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDocumentEfficiency() + { + return $this->document_efficiency; + } + + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDocumentEfficiency($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\DocumentEfficiency::class); + $this->document_efficiency = $var; + + return $this; + } + + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback|null + */ + public function getSummarizationFeedback() + { + return $this->summarization_feedback; + } + + public function hasSummarizationFeedback() + { + return isset($this->summarization_feedback); + } + + public function clearSummarizationFeedback() + { + unset($this->summarization_feedback); + } + + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback $var + * @return $this + */ + public function setSummarizationFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback::class); + $this->summarization_feedback = $var; + + return $this; + } + + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback|null + */ + public function getKnowledgeSearchFeedback() + { + return $this->knowledge_search_feedback; + } + + public function hasKnowledgeSearchFeedback() + { + return isset($this->knowledge_search_feedback); + } + + public function clearKnowledgeSearchFeedback() + { + unset($this->knowledge_search_feedback); + } + + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $var + * @return $this + */ + public function setKnowledgeSearchFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback::class); + $this->knowledge_search_feedback = $var; + + return $this; + } + + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback|null + */ + public function getKnowledgeAssistFeedback() + { + return $this->knowledge_assist_feedback; + } + + public function hasKnowledgeAssistFeedback() + { + return isset($this->knowledge_assist_feedback); + } + + public function clearKnowledgeAssistFeedback() + { + unset($this->knowledge_assist_feedback); + } + + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $var + * @return $this + */ + public function setKnowledgeAssistFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback::class); + $this->knowledge_assist_feedback = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php new file mode 100644 index 000000000000..06a4777e8e41 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance + */ +class AnswerRelevance +{ + /** + * Answer relevance unspecified. + * + * Generated from protobuf enum ANSWER_RELEVANCE_UNSPECIFIED = 0; + */ + const ANSWER_RELEVANCE_UNSPECIFIED = 0; + /** + * Answer is irrelevant to query. + * + * Generated from protobuf enum IRRELEVANT = 1; + */ + const IRRELEVANT = 1; + /** + * Answer is relevant to query. + * + * Generated from protobuf enum RELEVANT = 2; + */ + const RELEVANT = 2; + + private static $valueToName = [ + self::ANSWER_RELEVANCE_UNSPECIFIED => 'ANSWER_RELEVANCE_UNSPECIFIED', + self::IRRELEVANT => 'IRRELEVANT', + self::RELEVANT => 'RELEVANT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php new file mode 100644 index 000000000000..4ccbb17d8624 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness + */ +class DocumentCorrectness +{ + /** + * Document correctness unspecified. + * + * Generated from protobuf enum DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; + */ + const DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; + /** + * Information in document is incorrect. + * + * Generated from protobuf enum INCORRECT = 1; + */ + const INCORRECT = 1; + /** + * Information in document is correct. + * + * Generated from protobuf enum CORRECT = 2; + */ + const CORRECT = 2; + + private static $valueToName = [ + self::DOCUMENT_CORRECTNESS_UNSPECIFIED => 'DOCUMENT_CORRECTNESS_UNSPECIFIED', + self::INCORRECT => 'INCORRECT', + self::CORRECT => 'CORRECT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php new file mode 100644 index 000000000000..1ad23908ff55 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency + */ +class DocumentEfficiency +{ + /** + * Document efficiency unspecified. + * + * Generated from protobuf enum DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; + */ + const DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; + /** + * Document is inefficient. + * + * Generated from protobuf enum INEFFICIENT = 1; + */ + const INEFFICIENT = 1; + /** + * Document is efficient. + * + * Generated from protobuf enum EFFICIENT = 2; + */ + const EFFICIENT = 2; + + private static $valueToName = [ + self::DOCUMENT_EFFICIENCY_UNSPECIFIED => 'DOCUMENT_EFFICIENCY_UNSPECIFIED', + self::INEFFICIENT => 'INEFFICIENT', + self::EFFICIENT => 'EFFICIENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php new file mode 100644 index 000000000000..1c3ba55162db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback + */ +class KnowledgeAssistFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + */ + protected $answer_copied = false; + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + */ + private $clicked_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_copied + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * @type string[] $clicked_uris + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @return bool + */ + public function getAnswerCopied() + { + return $this->answer_copied; + } + + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @param bool $var + * @return $this + */ + public function setAnswerCopied($var) + { + GPBUtil::checkBool($var); + $this->answer_copied = $var; + + return $this; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @return RepeatedField + */ + public function getClickedUris() + { + return $this->clicked_uris; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @param string[] $var + * @return $this + */ + public function setClickedUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->clicked_uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php new file mode 100644 index 000000000000..ceabb3607d7b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback + */ +class KnowledgeSearchFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + */ + protected $answer_copied = false; + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + */ + private $clicked_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_copied + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * @type string[] $clicked_uris + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @return bool + */ + public function getAnswerCopied() + { + return $this->answer_copied; + } + + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @param bool $var + * @return $this + */ + public function setAnswerCopied($var) + { + GPBUtil::checkBool($var); + $this->answer_copied = $var; + + return $this; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @return RepeatedField + */ + public function getClickedUris() + { + return $this->clicked_uris; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @param string[] $var + * @return $this + */ + public function setClickedUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->clicked_uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php new file mode 100644 index 000000000000..f0c66f5e57e3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php @@ -0,0 +1,189 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback + */ +class SummarizationFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + */ + protected $submit_time = null; + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + */ + protected $summary_text = ''; + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $text_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Timestamp when composing of the summary starts. + * @type \Google\Protobuf\Timestamp $submit_time + * Timestamp when the summary was submitted. + * @type string $summary_text + * Text of actual submitted summary. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * Optional. Actual text sections of submitted summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSubmitTime() + { + return $this->submit_time; + } + + public function hasSubmitTime() + { + return isset($this->submit_time); + } + + public function clearSubmitTime() + { + unset($this->submit_time); + } + + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSubmitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->submit_time = $var; + + return $this; + } + + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + * @return string + */ + public function getSummaryText() + { + return $this->summary_text; + } + + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + * @param string $var + * @return $this + */ + public function setSummaryText($var) + { + GPBUtil::checkString($var, True); + $this->summary_text = $var; + + return $this; + } + + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php new file mode 100644 index 000000000000..215fa0d8ad0e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php @@ -0,0 +1,174 @@ +google.cloud.dialogflow.v2.AgentAssistantRecord + */ +class AgentAssistantRecord extends \Google\Protobuf\Internal\Message +{ + protected $answer; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ArticleAnswer $article_suggestion_answer + * Output only. The article suggestion answer. + * @type \Google\Cloud\Dialogflow\V2\FaqAnswer $faq_answer + * Output only. The FAQ answer. + * @type \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $dialogflow_assist_answer + * Output only. Dialogflow assist answer. + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion + * Output only. The generator suggestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The article suggestion answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleAnswer article_suggestion_answer = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ArticleAnswer|null + */ + public function getArticleSuggestionAnswer() + { + return $this->readOneof(5); + } + + public function hasArticleSuggestionAnswer() + { + return $this->hasOneof(5); + } + + /** + * Output only. The article suggestion answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleAnswer article_suggestion_answer = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ArticleAnswer $var + * @return $this + */ + public function setArticleSuggestionAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ArticleAnswer::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. The FAQ answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FaqAnswer faq_answer = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\FaqAnswer|null + */ + public function getFaqAnswer() + { + return $this->readOneof(6); + } + + public function hasFaqAnswer() + { + return $this->hasOneof(6); + } + + /** + * Output only. The FAQ answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FaqAnswer faq_answer = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\FaqAnswer $var + * @return $this + */ + public function setFaqAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FaqAnswer::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. Dialogflow assist answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer|null + */ + public function getDialogflowAssistAnswer() + { + return $this->readOneof(7); + } + + public function hasDialogflowAssistAnswer() + { + return $this->hasOneof(7); + } + + /** + * Output only. Dialogflow assist answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $var + * @return $this + */ + public function setDialogflowAssistAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. The generator suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getGeneratorSuggestion() + { + return $this->readOneof(8); + } + + public function hasGeneratorSuggestion() + { + return $this->hasOneof(8); + } + + /** + * Output only. The generator suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setGeneratorSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * @return string + */ + public function getAnswer() + { + return $this->whichOneof("answer"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingContext.php new file mode 100644 index 000000000000..e4ddc1e2371b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingContext.php @@ -0,0 +1,177 @@ +google.cloud.dialogflow.v2.AgentCoachingContext + */ +class AgentCoachingContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The overarching guidance for the agent coaching. This should be + * set only for v1.5 and later versions. + * + * Generated from protobuf field string overarching_guidance = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $overarching_guidance = ''; + /** + * Optional. Customized instructions for agent coaching. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $instructions; + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.2"]. + * + * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version = ''; + /** + * Optional. Output language code. + * + * Generated from protobuf field string output_language_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $overarching_guidance + * Optional. The overarching guidance for the agent coaching. This should be + * set only for v1.5 and later versions. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction[] $instructions + * Optional. Customized instructions for agent coaching. + * @type string $version + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.2"]. + * @type string $output_language_code + * Optional. Output language code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The overarching guidance for the agent coaching. This should be + * set only for v1.5 and later versions. + * + * Generated from protobuf field string overarching_guidance = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOverarchingGuidance() + { + return $this->overarching_guidance; + } + + /** + * Optional. The overarching guidance for the agent coaching. This should be + * set only for v1.5 and later versions. + * + * Generated from protobuf field string overarching_guidance = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOverarchingGuidance($var) + { + GPBUtil::checkString($var, True); + $this->overarching_guidance = $var; + + return $this; + } + + /** + * Optional. Customized instructions for agent coaching. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AgentCoachingInstruction> + */ + public function getInstructions() + { + return $this->instructions; + } + + /** + * Optional. Customized instructions for agent coaching. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction[] $var + * @return $this + */ + public function setInstructions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction::class); + $this->instructions = $arr; + + return $this; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.2"]. + * + * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.2"]. + * + * Generated from protobuf field string version = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Optional. Output language code. + * + * Generated from protobuf field string output_language_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOutputLanguageCode() + { + return $this->output_language_code; + } + + /** + * Optional. Output language code. + * + * Generated from protobuf field string output_language_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOutputLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->output_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php new file mode 100644 index 000000000000..ea7009fa637b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction.php @@ -0,0 +1,317 @@ +google.cloud.dialogflow.v2.AgentCoachingInstruction + */ +class AgentCoachingInstruction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Display name for the instruction. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The detailed description of this instruction. + * + * Generated from protobuf field string display_details = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_details = ''; + /** + * Optional. The condition of the instruction. For example, "the customer + * wants to cancel an order". If the users want the instruction to be + * triggered unconditionally, the condition can be empty. + * + * Generated from protobuf field string condition = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition = ''; + /** + * Optional. The action that human agent should take. For example, "apologize + * for the slow shipping". If the users only want to use agent coaching for + * intent detection, agent_action can be empty + * + * Generated from protobuf field string agent_action = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_action = ''; + /** + * Optional. The action that system should take. For example, + * "call GetOrderTime with order_number={order number provided by the + * customer}". If the users don't have plugins or don't want to trigger + * plugins, the system_action can be empty + * + * Generated from protobuf field string system_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $system_action = ''; + /** + * Output only. Duplication check for the AgentCoachingInstruction. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult duplicate_check_result = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $duplicate_check_result = null; + /** + * Optional. The event that should trigger this instruction. + * If UNSPECIFIED, the instruction triggering will be same as the generator's + * trigger_event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEvent triggering_event = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $triggering_event = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Optional. Display name for the instruction. + * @type string $display_details + * Optional. The detailed description of this instruction. + * @type string $condition + * Optional. The condition of the instruction. For example, "the customer + * wants to cancel an order". If the users want the instruction to be + * triggered unconditionally, the condition can be empty. + * @type string $agent_action + * Optional. The action that human agent should take. For example, "apologize + * for the slow shipping". If the users only want to use agent coaching for + * intent detection, agent_action can be empty + * @type string $system_action + * Optional. The action that system should take. For example, + * "call GetOrderTime with order_number={order number provided by the + * customer}". If the users don't have plugins or don't want to trigger + * plugins, the system_action can be empty + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult $duplicate_check_result + * Output only. Duplication check for the AgentCoachingInstruction. + * @type int $triggering_event + * Optional. The event that should trigger this instruction. + * If UNSPECIFIED, the instruction triggering will be same as the generator's + * trigger_event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AgentCoachingInstruction::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Display name for the instruction. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Display name for the instruction. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The detailed description of this instruction. + * + * Generated from protobuf field string display_details = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayDetails() + { + return $this->display_details; + } + + /** + * Optional. The detailed description of this instruction. + * + * Generated from protobuf field string display_details = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayDetails($var) + { + GPBUtil::checkString($var, True); + $this->display_details = $var; + + return $this; + } + + /** + * Optional. The condition of the instruction. For example, "the customer + * wants to cancel an order". If the users want the instruction to be + * triggered unconditionally, the condition can be empty. + * + * Generated from protobuf field string condition = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCondition() + { + return $this->condition; + } + + /** + * Optional. The condition of the instruction. For example, "the customer + * wants to cancel an order". If the users want the instruction to be + * triggered unconditionally, the condition can be empty. + * + * Generated from protobuf field string condition = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Optional. The action that human agent should take. For example, "apologize + * for the slow shipping". If the users only want to use agent coaching for + * intent detection, agent_action can be empty + * + * Generated from protobuf field string agent_action = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAgentAction() + { + return $this->agent_action; + } + + /** + * Optional. The action that human agent should take. For example, "apologize + * for the slow shipping". If the users only want to use agent coaching for + * intent detection, agent_action can be empty + * + * Generated from protobuf field string agent_action = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAgentAction($var) + { + GPBUtil::checkString($var, True); + $this->agent_action = $var; + + return $this; + } + + /** + * Optional. The action that system should take. For example, + * "call GetOrderTime with order_number={order number provided by the + * customer}". If the users don't have plugins or don't want to trigger + * plugins, the system_action can be empty + * + * Generated from protobuf field string system_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSystemAction() + { + return $this->system_action; + } + + /** + * Optional. The action that system should take. For example, + * "call GetOrderTime with order_number={order number provided by the + * customer}". If the users don't have plugins or don't want to trigger + * plugins, the system_action can be empty + * + * Generated from protobuf field string system_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSystemAction($var) + { + GPBUtil::checkString($var, True); + $this->system_action = $var; + + return $this; + } + + /** + * Output only. Duplication check for the AgentCoachingInstruction. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult duplicate_check_result = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult|null + */ + public function getDuplicateCheckResult() + { + return $this->duplicate_check_result; + } + + public function hasDuplicateCheckResult() + { + return isset($this->duplicate_check_result); + } + + public function clearDuplicateCheckResult() + { + unset($this->duplicate_check_result); + } + + /** + * Output only. Duplication check for the AgentCoachingInstruction. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult duplicate_check_result = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult $var + * @return $this + */ + public function setDuplicateCheckResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult::class); + $this->duplicate_check_result = $var; + + return $this; + } + + /** + * Optional. The event that should trigger this instruction. + * If UNSPECIFIED, the instruction triggering will be same as the generator's + * trigger_event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEvent triggering_event = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTriggeringEvent() + { + return $this->triggering_event; + } + + /** + * Optional. The event that should trigger this instruction. + * If UNSPECIFIED, the instruction triggering will be same as the generator's + * trigger_event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEvent triggering_event = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTriggeringEvent($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\TriggerEvent::class); + $this->triggering_event = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult.php new file mode 100644 index 000000000000..ba9117e1b828 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult + */ +class DuplicateCheckResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The duplicate suggestions. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestion duplicate_suggestions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $duplicate_suggestions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult\DuplicateSuggestion[] $duplicate_suggestions + * Output only. The duplicate suggestions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AgentCoachingInstruction::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The duplicate suggestions. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestion duplicate_suggestions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult\DuplicateSuggestion> + */ + public function getDuplicateSuggestions() + { + return $this->duplicate_suggestions; + } + + /** + * Output only. The duplicate suggestions. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestion duplicate_suggestions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult\DuplicateSuggestion[] $var + * @return $this + */ + public function setDuplicateSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction\DuplicateCheckResult\DuplicateSuggestion::class); + $this->duplicate_suggestions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult/DuplicateSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult/DuplicateSuggestion.php new file mode 100644 index 000000000000..05206a8d3194 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/DuplicateCheckResult/DuplicateSuggestion.php @@ -0,0 +1,143 @@ +google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestion + */ +class DuplicateSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The answer record id of the past duplicate suggestion. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $answer_record = ''; + /** + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * + * Generated from protobuf field int32 suggestion_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $suggestion_index = 0; + /** + * Output only. The similarity score of between the past and current + * suggestion. + * + * Generated from protobuf field float similarity_score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $similarity_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_record + * Output only. The answer record id of the past duplicate suggestion. + * @type int $suggestion_index + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * @type float $similarity_score + * Output only. The similarity score of between the past and current + * suggestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AgentCoachingInstruction::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The answer record id of the past duplicate suggestion. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Output only. The answer record id of the past duplicate suggestion. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * + * Generated from protobuf field int32 suggestion_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSuggestionIndex() + { + return $this->suggestion_index; + } + + /** + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * + * Generated from protobuf field int32 suggestion_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSuggestionIndex($var) + { + GPBUtil::checkInt32($var); + $this->suggestion_index = $var; + + return $this; + } + + /** + * Output only. The similarity score of between the past and current + * suggestion. + * + * Generated from protobuf field float similarity_score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getSimilarityScore() + { + return $this->similarity_score; + } + + /** + * Output only. The similarity score of between the past and current + * suggestion. + * + * Generated from protobuf field float similarity_score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setSimilarityScore($var) + { + GPBUtil::checkFloat($var); + $this->similarity_score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/TriggerEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/TriggerEvent.php new file mode 100644 index 000000000000..552fc833153e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingInstruction/TriggerEvent.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEvent + */ +class TriggerEvent +{ + /** + * Default value for TriggerEvent. + * + * Generated from protobuf enum TRIGGER_EVENT_UNSPECIFIED = 0; + */ + const TRIGGER_EVENT_UNSPECIFIED = 0; + /** + * Triggers when each chat message or voice utterance ends. + * + * Generated from protobuf enum END_OF_UTTERANCE = 1; + */ + const END_OF_UTTERANCE = 1; + /** + * Triggers on the conversation manually by API calls. + * + * Generated from protobuf enum MANUAL_CALL = 2; + */ + const MANUAL_CALL = 2; + /** + * Triggers after each customer message. + * + * Generated from protobuf enum CUSTOMER_MESSAGE = 3; + */ + const CUSTOMER_MESSAGE = 3; + /** + * Triggers after each agent message. + * + * Generated from protobuf enum AGENT_MESSAGE = 4; + */ + const AGENT_MESSAGE = 4; + /** + * Triggers on tool call completion. + * + * Generated from protobuf enum TOOL_CALL_COMPLETION = 5; + */ + const TOOL_CALL_COMPLETION = 5; + + private static $valueToName = [ + self::TRIGGER_EVENT_UNSPECIFIED => 'TRIGGER_EVENT_UNSPECIFIED', + self::END_OF_UTTERANCE => 'END_OF_UTTERANCE', + self::MANUAL_CALL => 'MANUAL_CALL', + self::CUSTOMER_MESSAGE => 'CUSTOMER_MESSAGE', + self::AGENT_MESSAGE => 'AGENT_MESSAGE', + self::TOOL_CALL_COMPLETION => 'TOOL_CALL_COMPLETION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion.php new file mode 100644 index 000000000000..40f3c20a0705 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion.php @@ -0,0 +1,135 @@ +google.cloud.dialogflow.v2.AgentCoachingSuggestion + */ +class AgentCoachingSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Instructions applicable based on the current context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction applicable_instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $applicable_instructions; + /** + * Optional. Suggested actions for the agent to take. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestion agent_action_suggestions = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $agent_action_suggestions; + /** + * Optional. Sample response for the Agent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponse sample_responses = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sample_responses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction[] $applicable_instructions + * Optional. Instructions applicable based on the current context. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\AgentActionSuggestion[] $agent_action_suggestions + * Optional. Suggested actions for the agent to take. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\SampleResponse[] $sample_responses + * Optional. Sample response for the Agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Instructions applicable based on the current context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction applicable_instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AgentCoachingInstruction> + */ + public function getApplicableInstructions() + { + return $this->applicable_instructions; + } + + /** + * Optional. Instructions applicable based on the current context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingInstruction applicable_instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction[] $var + * @return $this + */ + public function setApplicableInstructions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AgentCoachingInstruction::class); + $this->applicable_instructions = $arr; + + return $this; + } + + /** + * Optional. Suggested actions for the agent to take. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestion agent_action_suggestions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\AgentActionSuggestion> + */ + public function getAgentActionSuggestions() + { + return $this->agent_action_suggestions; + } + + /** + * Optional. Suggested actions for the agent to take. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestion agent_action_suggestions = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\AgentActionSuggestion[] $var + * @return $this + */ + public function setAgentActionSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\AgentActionSuggestion::class); + $this->agent_action_suggestions = $arr; + + return $this; + } + + /** + * Optional. Sample response for the Agent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponse sample_responses = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\SampleResponse> + */ + public function getSampleResponses() + { + return $this->sample_responses; + } + + /** + * Optional. Sample response for the Agent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponse sample_responses = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\SampleResponse[] $var + * @return $this + */ + public function setSampleResponses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\SampleResponse::class); + $this->sample_responses = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/AgentActionSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/AgentActionSuggestion.php new file mode 100644 index 000000000000..67908a0d5f35 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/AgentActionSuggestion.php @@ -0,0 +1,155 @@ +google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestion + */ +class AgentActionSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The suggested action for the agent. + * + * Generated from protobuf field string agent_action = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_action = ''; + /** + * Output only. Sources for the agent action suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sources = null; + /** + * Output only. Duplicate check result for the agent action suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult duplicate_check_result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $duplicate_check_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent_action + * Optional. The suggested action for the agent. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources $sources + * Output only. Sources for the agent action suggestion. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult $duplicate_check_result + * Output only. Duplicate check result for the agent action suggestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The suggested action for the agent. + * + * Generated from protobuf field string agent_action = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAgentAction() + { + return $this->agent_action; + } + + /** + * Optional. The suggested action for the agent. + * + * Generated from protobuf field string agent_action = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAgentAction($var) + { + GPBUtil::checkString($var, True); + $this->agent_action = $var; + + return $this; + } + + /** + * Output only. Sources for the agent action suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources|null + */ + public function getSources() + { + return $this->sources; + } + + public function hasSources() + { + return isset($this->sources); + } + + public function clearSources() + { + unset($this->sources); + } + + /** + * Output only. Sources for the agent action suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources $var + * @return $this + */ + public function setSources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources::class); + $this->sources = $var; + + return $this; + } + + /** + * Output only. Duplicate check result for the agent action suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult duplicate_check_result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult|null + */ + public function getDuplicateCheckResult() + { + return $this->duplicate_check_result; + } + + public function hasDuplicateCheckResult() + { + return isset($this->duplicate_check_result); + } + + public function clearDuplicateCheckResult() + { + unset($this->duplicate_check_result); + } + + /** + * Output only. Duplicate check result for the agent action suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult duplicate_check_result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult $var + * @return $this + */ + public function setDuplicateCheckResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult::class); + $this->duplicate_check_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult.php new file mode 100644 index 000000000000..da71fbecb292 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult + */ +class DuplicateCheckResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The duplicate suggestions. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestion duplicate_suggestions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $duplicate_suggestions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult\DuplicateSuggestion[] $duplicate_suggestions + * Output only. The duplicate suggestions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The duplicate suggestions. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestion duplicate_suggestions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult\DuplicateSuggestion> + */ + public function getDuplicateSuggestions() + { + return $this->duplicate_suggestions; + } + + /** + * Output only. The duplicate suggestions. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestion duplicate_suggestions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult\DuplicateSuggestion[] $var + * @return $this + */ + public function setDuplicateSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult\DuplicateSuggestion::class); + $this->duplicate_suggestions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult/DuplicateSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult/DuplicateSuggestion.php new file mode 100644 index 000000000000..75c86e97e315 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/DuplicateCheckResult/DuplicateSuggestion.php @@ -0,0 +1,189 @@ +google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestion + */ +class DuplicateSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The answer record id of the past duplicate suggestion. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $answer_record = ''; + /** + * Output only. Sources for the suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sources = null; + /** + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * + * Generated from protobuf field int32 suggestion_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $suggestion_index = 0; + /** + * Output only. The similarity score of between the past and current + * suggestion. + * + * Generated from protobuf field float similarity_score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $similarity_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_record + * Output only. The answer record id of the past duplicate suggestion. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources $sources + * Output only. Sources for the suggestion. + * @type int $suggestion_index + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * @type float $similarity_score + * Output only. The similarity score of between the past and current + * suggestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The answer record id of the past duplicate suggestion. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Output only. The answer record id of the past duplicate suggestion. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * Output only. Sources for the suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources|null + */ + public function getSources() + { + return $this->sources; + } + + public function hasSources() + { + return isset($this->sources); + } + + public function clearSources() + { + unset($this->sources); + } + + /** + * Output only. Sources for the suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources $var + * @return $this + */ + public function setSources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources::class); + $this->sources = $var; + + return $this; + } + + /** + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * + * Generated from protobuf field int32 suggestion_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSuggestionIndex() + { + return $this->suggestion_index; + } + + /** + * Output only. The index of the duplicate suggestion in the past + * suggestion list. + * + * Generated from protobuf field int32 suggestion_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSuggestionIndex($var) + { + GPBUtil::checkInt32($var); + $this->suggestion_index = $var; + + return $this; + } + + /** + * Output only. The similarity score of between the past and current + * suggestion. + * + * Generated from protobuf field float similarity_score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getSimilarityScore() + { + return $this->similarity_score; + } + + /** + * Output only. The similarity score of between the past and current + * suggestion. + * + * Generated from protobuf field float similarity_score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setSimilarityScore($var) + { + GPBUtil::checkFloat($var); + $this->similarity_score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/SampleResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/SampleResponse.php new file mode 100644 index 000000000000..306152e069d1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/SampleResponse.php @@ -0,0 +1,156 @@ +google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponse + */ +class SampleResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Sample response for Agent in text. + * + * Generated from protobuf field string response_text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $response_text = ''; + /** + * Output only. Sources for the Sample Response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sources = null; + /** + * Output only. Duplicate check result for the sample response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult duplicate_check_result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $duplicate_check_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response_text + * Optional. Sample response for Agent in text. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources $sources + * Output only. Sources for the Sample Response. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult $duplicate_check_result + * Output only. Duplicate check result for the sample response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Sample response for Agent in text. + * + * Generated from protobuf field string response_text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getResponseText() + { + return $this->response_text; + } + + /** + * Optional. Sample response for Agent in text. + * + * Generated from protobuf field string response_text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setResponseText($var) + { + GPBUtil::checkString($var, True); + $this->response_text = $var; + + return $this; + } + + /** + * Output only. Sources for the Sample Response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources|null + */ + public function getSources() + { + return $this->sources; + } + + public function hasSources() + { + return isset($this->sources); + } + + public function clearSources() + { + unset($this->sources); + } + + /** + * Output only. Sources for the Sample Response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources sources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources $var + * @return $this + */ + public function setSources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\Sources::class); + $this->sources = $var; + + return $this; + } + + /** + * Output only. Duplicate check result for the sample response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult duplicate_check_result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult|null + */ + public function getDuplicateCheckResult() + { + return $this->duplicate_check_result; + } + + public function hasDuplicateCheckResult() + { + return isset($this->duplicate_check_result); + } + + public function clearDuplicateCheckResult() + { + unset($this->duplicate_check_result); + } + + /** + * Output only. Duplicate check result for the sample response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult duplicate_check_result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult $var + * @return $this + */ + public function setDuplicateCheckResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion\DuplicateCheckResult::class); + $this->duplicate_check_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/Sources.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/Sources.php new file mode 100644 index 000000000000..20b41626dea9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentCoachingSuggestion/Sources.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources + */ +class Sources extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Source instruction indexes for the suggestion. This is the + * index of the applicable_instructions field. + * + * Generated from protobuf field repeated int32 instruction_indexes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $instruction_indexes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[] $instruction_indexes + * Output only. Source instruction indexes for the suggestion. This is the + * index of the applicable_instructions field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Source instruction indexes for the suggestion. This is the + * index of the applicable_instructions field. + * + * Generated from protobuf field repeated int32 instruction_indexes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getInstructionIndexes() + { + return $this->instruction_indexes; + } + + /** + * Output only. Source instruction indexes for the suggestion. This is the + * index of the applicable_instructions field. + * + * Generated from protobuf field repeated int32 instruction_indexes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int[] $var + * @return $this + */ + public function setInstructionIndexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->instruction_indexes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php new file mode 100644 index 000000000000..ae4fe33cf435 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php @@ -0,0 +1,521 @@ +google.cloud.dialogflow.v2.AnalyzeContentRequest + */ +class AnalyzeContentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $participant = ''; + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + */ + protected $reply_audio_config = null; + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + */ + protected $query_params = null; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + */ + protected $assist_query_params = null; + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + */ + protected $cx_parameters = null; + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + */ + protected $request_id = ''; + protected $input; + + /** + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\TextInput $textInput The natural language text to be processed. + * + * @return \Google\Cloud\Dialogflow\V2\AnalyzeContentRequest + * + * @experimental + */ + public static function build(string $participant, \Google\Cloud\Dialogflow\V2\TextInput $textInput): self + { + return (new self()) + ->setParticipant($participant) + ->setTextInput($textInput); + } + + /** + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EventInput $eventInput An input event to send to Dialogflow. + * + * @return \Google\Cloud\Dialogflow\V2\AnalyzeContentRequest + * + * @experimental + */ + public static function buildFromParticipantEventInput(string $participant, \Google\Cloud\Dialogflow\V2\EventInput $eventInput): self + { + return (new self()) + ->setParticipant($participant) + ->setEventInput($eventInput); + } + + /** + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\AudioInput $audioInput The natural language speech audio to be processed. + * + * @return \Google\Cloud\Dialogflow\V2\AnalyzeContentRequest + * + * @experimental + */ + public static function buildFromParticipantAudioInput(string $participant, \Google\Cloud\Dialogflow\V2\AudioInput $audioInput): self + { + return (new self()) + ->setParticipant($participant) + ->setAudioInput($audioInput); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $participant + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $text_input + * The natural language text to be processed. + * @type \Google\Cloud\Dialogflow\V2\AudioInput $audio_input + * The natural language speech audio to be processed. + * @type \Google\Cloud\Dialogflow\V2\EventInput $event_input + * An input event to send to Dialogflow. + * @type \Google\Cloud\Dialogflow\V2\SuggestionInput $suggestion_input + * An input representing the selection of a suggestion. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $reply_audio_config + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * Parameters for a Dialogflow virtual-agent query. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * @type \Google\Protobuf\Struct $cx_parameters + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getTextInput() + { + return $this->readOneof(6); + } + + public function hasTextInput() + { + return $this->hasOneof(6); + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The natural language speech audio to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioInput audio_input = 7; + * @return \Google\Cloud\Dialogflow\V2\AudioInput|null + */ + public function getAudioInput() + { + return $this->readOneof(7); + } + + public function hasAudioInput() + { + return $this->hasOneof(7); + } + + /** + * The natural language speech audio to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioInput audio_input = 7; + * @param \Google\Cloud\Dialogflow\V2\AudioInput $var + * @return $this + */ + public function setAudioInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AudioInput::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * An input event to send to Dialogflow. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getEventInput() + { + return $this->readOneof(8); + } + + public function hasEventInput() + { + return $this->hasOneof(8); + } + + /** + * An input event to send to Dialogflow. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setEventInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * An input representing the selection of a suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; + * @return \Google\Cloud\Dialogflow\V2\SuggestionInput|null + */ + public function getSuggestionInput() + { + return $this->readOneof(12); + } + + public function hasSuggestionInput() + { + return $this->hasOneof(12); + } + + /** + * An input representing the selection of a suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; + * @param \Google\Cloud\Dialogflow\V2\SuggestionInput $var + * @return $this + */ + public function setSuggestionInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionInput::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getReplyAudioConfig() + { + return $this->reply_audio_config; + } + + public function hasReplyAudioConfig() + { + return isset($this->reply_audio_config); + } + + public function clearReplyAudioConfig() + { + unset($this->reply_audio_config); + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setReplyAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->reply_audio_config = $var; + + return $this; + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + * @return \Google\Protobuf\Struct|null + */ + public function getCxParameters() + { + return $this->cx_parameters; + } + + public function hasCxParameters() + { + return isset($this->cx_parameters); + } + + public function clearCxParameters() + { + unset($this->cx_parameters); + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCxParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->cx_parameters = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php new file mode 100644 index 000000000000..7c6b2383af0f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php @@ -0,0 +1,432 @@ +google.cloud.dialogflow.v2.AnalyzeContentResponse + */ +class AnalyzeContentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * + * Generated from protobuf field string reply_text = 1; + */ + protected $reply_text = ''; + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 2; + */ + protected $reply_audio = null; + /** + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 3; + */ + protected $automated_agent_reply = null; + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 5; + */ + protected $message = null; + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 6; + */ + private $human_agent_suggestion_results; + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 7; + */ + private $end_user_suggestion_results; + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 9; + */ + protected $dtmf_parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reply_text + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * @type \Google\Cloud\Dialogflow\V2\OutputAudio $reply_audio + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $automated_agent_reply + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * @type \Google\Cloud\Dialogflow\V2\Message $message + * Message analyzed by CCAI. + * @type \Google\Cloud\Dialogflow\V2\SuggestionResult[] $human_agent_suggestion_results + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * @type \Google\Cloud\Dialogflow\V2\SuggestionResult[] $end_user_suggestion_results + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * @type \Google\Cloud\Dialogflow\V2\DtmfParameters $dtmf_parameters + * Indicates the parameters of DTMF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * + * Generated from protobuf field string reply_text = 1; + * @return string + */ + public function getReplyText() + { + return $this->reply_text; + } + + /** + * The output text content. + * This field is set if the automated agent responded with text to show to + * the user. + * + * Generated from protobuf field string reply_text = 1; + * @param string $var + * @return $this + */ + public function setReplyText($var) + { + GPBUtil::checkString($var, True); + $this->reply_text = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 2; + * @return \Google\Cloud\Dialogflow\V2\OutputAudio|null + */ + public function getReplyAudio() + { + return $this->reply_audio; + } + + public function hasReplyAudio() + { + return isset($this->reply_audio); + } + + public function clearReplyAudio() + { + unset($this->reply_audio); + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - `reply_audio_config` was specified in the request, or + * - The automated agent responded with audio to play to the user. In such + * case, `reply_audio.config` contains settings used to synthesize the + * speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 2; + * @param \Google\Cloud\Dialogflow\V2\OutputAudio $var + * @return $this + */ + public function setReplyAudio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudio::class); + $this->reply_audio = $var; + + return $this; + } + + /** + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 3; + * @return \Google\Cloud\Dialogflow\V2\AutomatedAgentReply|null + */ + public function getAutomatedAgentReply() + { + return $this->automated_agent_reply; + } + + public function hasAutomatedAgentReply() + { + return isset($this->automated_agent_reply); + } + + public function clearAutomatedAgentReply() + { + unset($this->automated_agent_reply); + } + + /** + * Only set if a Dialogflow automated agent has responded. + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 3; + * @param \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $var + * @return $this + */ + public function setAutomatedAgentReply($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply::class); + $this->automated_agent_reply = $var; + + return $this; + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 5; + * @return \Google\Cloud\Dialogflow\V2\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 5; + * @param \Google\Cloud\Dialogflow\V2\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Message::class); + $this->message = $var; + + return $this; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 6; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SuggestionResult> + */ + public function getHumanAgentSuggestionResults() + { + return $this->human_agent_suggestion_results; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * Note that any failure of Agent Assist features will not lead to the overall + * failure of an AnalyzeContent API call. Instead, the features will + * fail silently with the error field set in the corresponding + * SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 6; + * @param \Google\Cloud\Dialogflow\V2\SuggestionResult[] $var + * @return $this + */ + public function setHumanAgentSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->human_agent_suggestion_results = $arr; + + return $this; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 7; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SuggestionResult> + */ + public function getEndUserSuggestionResults() + { + return $this->end_user_suggestion_results; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * Same as human_agent_suggestion_results, any failure of Agent Assist + * features will not lead to the overall failure of an AnalyzeContent API + * call. Instead, the features will fail silently with the error field set in + * the corresponding SuggestionResult. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 7; + * @param \Google\Cloud\Dialogflow\V2\SuggestionResult[] $var + * @return $this + */ + public function setEndUserSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->end_user_suggestion_results = $arr; + + return $this; + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 9; + * @return \Google\Cloud\Dialogflow\V2\DtmfParameters|null + */ + public function getDtmfParameters() + { + return $this->dtmf_parameters; + } + + public function hasDtmfParameters() + { + return isset($this->dtmf_parameters); + } + + public function clearDtmfParameters() + { + unset($this->dtmf_parameters); + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 9; + * @param \Google\Cloud\Dialogflow\V2\DtmfParameters $var + * @return $this + */ + public function setDtmfParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DtmfParameters::class); + $this->dtmf_parameters = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnnotatedMessagePart.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnnotatedMessagePart.php new file mode 100644 index 000000000000..85275a7f5785 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnnotatedMessagePart.php @@ -0,0 +1,195 @@ +google.cloud.dialogflow.v2.AnnotatedMessagePart + */ +class AnnotatedMessagePart extends \Google\Protobuf\Internal\Message +{ + /** + * A part of a message possibly annotated with an entity. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * + * Generated from protobuf field string entity_type = 2; + */ + protected $entity_type = ''; + /** + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `\@sys.unit-currency`, this may contain: + *
+     * {
+     *   "amount": 5,
+     *   "currency": "USD"
+     * }
+     * 
+ * + * Generated from protobuf field .google.protobuf.Value formatted_value = 3; + */ + protected $formatted_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * A part of a message possibly annotated with an entity. + * @type string $entity_type + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * @type \Google\Protobuf\Value $formatted_value + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `\@sys.unit-currency`, this may contain: + *
+     *           {
+     *             "amount": 5,
+     *             "currency": "USD"
+     *           }
+     *           
+ * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * A part of a message possibly annotated with an entity. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * A part of a message possibly annotated with an entity. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * + * Generated from protobuf field string entity_type = 2; + * @return string + */ + public function getEntityType() + { + return $this->entity_type; + } + + /** + * The [Dialogflow system entity + * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + * of this message part. If this is empty, Dialogflow could not annotate the + * phrase part with a system entity. + * + * Generated from protobuf field string entity_type = 2; + * @param string $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkString($var, True); + $this->entity_type = $var; + + return $this; + } + + /** + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `\@sys.unit-currency`, this may contain: + *
+     * {
+     *   "amount": 5,
+     *   "currency": "USD"
+     * }
+     * 
+ * + * Generated from protobuf field .google.protobuf.Value formatted_value = 3; + * @return \Google\Protobuf\Value|null + */ + public function getFormattedValue() + { + return $this->formatted_value; + } + + public function hasFormattedValue() + { + return isset($this->formatted_value); + } + + public function clearFormattedValue() + { + unset($this->formatted_value); + } + + /** + * The [Dialogflow system entity formatted value + * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + * this message part. For example for a system entity of type + * `\@sys.unit-currency`, this may contain: + *
+     * {
+     *   "amount": 5,
+     *   "currency": "USD"
+     * }
+     * 
+ * + * Generated from protobuf field .google.protobuf.Value formatted_value = 3; + * @param \Google\Protobuf\Value $var + * @return $this + */ + public function setFormattedValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); + $this->formatted_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback.php new file mode 100644 index 000000000000..0a690b49c49e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback.php @@ -0,0 +1,282 @@ +google.cloud.dialogflow.v2.AnswerFeedback + */ +class AnswerFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * The correctness level of the specific answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1; + */ + protected $correctness_level = 0; + /** + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * + * Generated from protobuf field bool clicked = 3; + */ + protected $clicked = false; + /** + * Time when the answer/item was clicked. + * + * Generated from protobuf field .google.protobuf.Timestamp click_time = 5; + */ + protected $click_time = null; + /** + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * + * Generated from protobuf field bool displayed = 4; + */ + protected $displayed = false; + /** + * Time when the answer/item was displayed. + * + * Generated from protobuf field .google.protobuf.Timestamp display_time = 6; + */ + protected $display_time = null; + protected $detail_feedback; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $correctness_level + * The correctness level of the specific answer. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback $agent_assistant_detail_feedback + * Detail feedback of agent assist suggestions. + * @type bool $clicked + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * @type \Google\Protobuf\Timestamp $click_time + * Time when the answer/item was clicked. + * @type bool $displayed + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * @type \Google\Protobuf\Timestamp $display_time + * Time when the answer/item was displayed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * The correctness level of the specific answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1; + * @return int + */ + public function getCorrectnessLevel() + { + return $this->correctness_level; + } + + /** + * The correctness level of the specific answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1; + * @param int $var + * @return $this + */ + public function setCorrectnessLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AnswerFeedback\CorrectnessLevel::class); + $this->correctness_level = $var; + + return $this; + } + + /** + * Detail feedback of agent assist suggestions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback agent_assistant_detail_feedback = 2; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback|null + */ + public function getAgentAssistantDetailFeedback() + { + return $this->readOneof(2); + } + + public function hasAgentAssistantDetailFeedback() + { + return $this->hasOneof(2); + } + + /** + * Detail feedback of agent assist suggestions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback agent_assistant_detail_feedback = 2; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback $var + * @return $this + */ + public function setAgentAssistantDetailFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * + * Generated from protobuf field bool clicked = 3; + * @return bool + */ + public function getClicked() + { + return $this->clicked; + } + + /** + * Indicates whether the answer/item was clicked by the human agent + * or not. Default to false. + * For knowledge search and knowledge assist, the answer record is considered + * to be clicked if the answer was copied or any URI was clicked. + * + * Generated from protobuf field bool clicked = 3; + * @param bool $var + * @return $this + */ + public function setClicked($var) + { + GPBUtil::checkBool($var); + $this->clicked = $var; + + return $this; + } + + /** + * Time when the answer/item was clicked. + * + * Generated from protobuf field .google.protobuf.Timestamp click_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getClickTime() + { + return $this->click_time; + } + + public function hasClickTime() + { + return isset($this->click_time); + } + + public function clearClickTime() + { + unset($this->click_time); + } + + /** + * Time when the answer/item was clicked. + * + * Generated from protobuf field .google.protobuf.Timestamp click_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setClickTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->click_time = $var; + + return $this; + } + + /** + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * + * Generated from protobuf field bool displayed = 4; + * @return bool + */ + public function getDisplayed() + { + return $this->displayed; + } + + /** + * Indicates whether the answer/item was displayed to the human + * agent in the agent desktop UI. Default to false. + * + * Generated from protobuf field bool displayed = 4; + * @param bool $var + * @return $this + */ + public function setDisplayed($var) + { + GPBUtil::checkBool($var); + $this->displayed = $var; + + return $this; + } + + /** + * Time when the answer/item was displayed. + * + * Generated from protobuf field .google.protobuf.Timestamp display_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDisplayTime() + { + return $this->display_time; + } + + public function hasDisplayTime() + { + return isset($this->display_time); + } + + public function clearDisplayTime() + { + unset($this->display_time); + } + + /** + * Time when the answer/item was displayed. + * + * Generated from protobuf field .google.protobuf.Timestamp display_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDisplayTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->display_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getDetailFeedback() + { + return $this->whichOneof("detail_feedback"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php new file mode 100644 index 000000000000..e14eba84ebca --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel + */ +class CorrectnessLevel +{ + /** + * Correctness level unspecified. + * + * Generated from protobuf enum CORRECTNESS_LEVEL_UNSPECIFIED = 0; + */ + const CORRECTNESS_LEVEL_UNSPECIFIED = 0; + /** + * Answer is totally wrong. + * + * Generated from protobuf enum NOT_CORRECT = 1; + */ + const NOT_CORRECT = 1; + /** + * Answer is partially correct. + * + * Generated from protobuf enum PARTIALLY_CORRECT = 2; + */ + const PARTIALLY_CORRECT = 2; + /** + * Answer is fully correct. + * + * Generated from protobuf enum FULLY_CORRECT = 3; + */ + const FULLY_CORRECT = 3; + + private static $valueToName = [ + self::CORRECTNESS_LEVEL_UNSPECIFIED => 'CORRECTNESS_LEVEL_UNSPECIFIED', + self::NOT_CORRECT => 'NOT_CORRECT', + self::PARTIALLY_CORRECT => 'PARTIALLY_CORRECT', + self::FULLY_CORRECT => 'FULLY_CORRECT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php new file mode 100644 index 000000000000..29b6f44de51d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php @@ -0,0 +1,190 @@ +google.cloud.dialogflow.v2.AnswerRecord + */ +class AnswerRecord extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback answer_feedback = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_feedback = null; + protected $record; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * @type \Google\Cloud\Dialogflow\V2\AnswerFeedback $answer_feedback + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantRecord $agent_assistant_record + * Output only. The record for human agent assistant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of this answer record. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback answer_feedback = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\AnswerFeedback|null + */ + public function getAnswerFeedback() + { + return $this->answer_feedback; + } + + public function hasAnswerFeedback() + { + return isset($this->answer_feedback); + } + + public function clearAnswerFeedback() + { + unset($this->answer_feedback); + } + + /** + * Required. The AnswerFeedback for this record. You can set this with + * [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] + * in order to give us feedback about this answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerFeedback answer_feedback = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\AnswerFeedback $var + * @return $this + */ + public function setAnswerFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AnswerFeedback::class); + $this->answer_feedback = $var; + + return $this; + } + + /** + * Output only. The record for human agent assistant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantRecord agent_assistant_record = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantRecord|null + */ + public function getAgentAssistantRecord() + { + return $this->readOneof(4); + } + + public function hasAgentAssistantRecord() + { + return $this->hasOneof(4); + } + + /** + * Output only. The record for human agent assistant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantRecord agent_assistant_record = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantRecord $var + * @return $this + */ + public function setAgentAssistantRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantRecord::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getRecord() + { + return $this->whichOneof("record"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleAnswer.php new file mode 100644 index 000000000000..2c3ad7b067be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleAnswer.php @@ -0,0 +1,261 @@ +google.cloud.dialogflow.v2.ArticleAnswer + */ +class ArticleAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The article title. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The article URI. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + */ + private $snippets; + /** + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + */ + private $metadata; + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The article title. + * @type string $uri + * The article URI. + * @type string[] $snippets + * Article snippets. + * @type float $confidence + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * @type array|\Google\Protobuf\Internal\MapField $metadata + * A map that contains metadata about the answer and the + * document from which it originates. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The article title. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The article title. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The article URI. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The article URI. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + * @return RepeatedField + */ + public function getSnippets() + { + return $this->snippets; + } + + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + * @param string[] $var + * @return $this + */ + public function setSnippets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->snippets = $arr; + + return $this; + } + + /** + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Article match confidence. + * The system's confidence score that this article is a good match for this + * conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleSuggestionModelMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleSuggestionModelMetadata.php new file mode 100644 index 000000000000..613feba9a377 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleSuggestionModelMetadata.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata + */ +class ArticleSuggestionModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $training_model_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $training_model_type + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTrainingModelType() + { + return $this->training_model_type; + } + + /** + * Optional. Type of the article suggestion model. If not provided, model_type + * is used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTrainingModelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\ModelType::class); + $this->training_model_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AssistQueryParameters.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AssistQueryParameters.php new file mode 100644 index 000000000000..d218922d972b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AssistQueryParameters.php @@ -0,0 +1,131 @@ +google.cloud.dialogflow.v2.AssistQueryParameters + */ +class AssistQueryParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 1; + */ + private $documents_metadata_filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $documents_metadata_filters + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDocumentsMetadataFilters() + { + return $this->documents_metadata_filters; + } + + /** + * Key-value filters on the metadata of documents returned by article + * suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDocumentsMetadataFilters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents_metadata_filters = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php new file mode 100644 index 000000000000..e630d149e731 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php @@ -0,0 +1,125 @@ +google.cloud.dialogflow.v2.AudioEncoding + */ +class AudioEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * + * Generated from protobuf enum AUDIO_ENCODING_LINEAR_16 = 1; + */ + const AUDIO_ENCODING_LINEAR_16 = 1; + /** + * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + * Codec) is the recommended encoding because it is lossless (therefore + * recognition is not compromised) and requires only about half the + * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + * 24-bit samples, however, not all fields in `STREAMINFO` are supported. + * + * Generated from protobuf enum AUDIO_ENCODING_FLAC = 2; + */ + const AUDIO_ENCODING_FLAC = 2; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * + * Generated from protobuf enum AUDIO_ENCODING_MULAW = 3; + */ + const AUDIO_ENCODING_MULAW = 3; + /** + * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + * + * Generated from protobuf enum AUDIO_ENCODING_AMR = 4; + */ + const AUDIO_ENCODING_AMR = 4; + /** + * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_AMR_WB = 5; + */ + const AUDIO_ENCODING_AMR_WB = 5; + /** + * Opus encoded audio frames in Ogg container + * ([OggOpus](https://wiki.xiph.org/OggOpus)). + * `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_OGG_OPUS = 6; + */ + const AUDIO_ENCODING_OGG_OPUS = 6; + /** + * Although the use of lossy encodings is not recommended, if a very low + * bitrate encoding is required, `OGG_OPUS` is highly preferred over + * Speex encoding. The [Speex](https://speex.org/) encoding supported by + * Dialogflow API has a header byte in each block, as in MIME type + * `audio/x-speex-with-header-byte`. + * It is a variant of the RTP Speex encoding defined in + * [RFC 5574](https://tools.ietf.org/html/rfc5574). + * The stream is a sequence of blocks, one block per RTP packet. Each block + * starts with a byte containing the length of the block, in bytes, followed + * by one or more frames of Speex data, padded to an integral number of + * bytes (octets) as specified in RFC 5574. In other words, each RTP header + * is replaced with a single byte containing the block length. Only Speex + * wideband is supported. `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + */ + const AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum AUDIO_ENCODING_ALAW = 8; + */ + const AUDIO_ENCODING_ALAW = 8; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::AUDIO_ENCODING_LINEAR_16 => 'AUDIO_ENCODING_LINEAR_16', + self::AUDIO_ENCODING_FLAC => 'AUDIO_ENCODING_FLAC', + self::AUDIO_ENCODING_MULAW => 'AUDIO_ENCODING_MULAW', + self::AUDIO_ENCODING_AMR => 'AUDIO_ENCODING_AMR', + self::AUDIO_ENCODING_AMR_WB => 'AUDIO_ENCODING_AMR_WB', + self::AUDIO_ENCODING_OGG_OPUS => 'AUDIO_ENCODING_OGG_OPUS', + self::AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE => 'AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', + self::AUDIO_ENCODING_ALAW => 'AUDIO_ENCODING_ALAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioInput.php new file mode 100644 index 000000000000..f3c45d461d26 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioInput.php @@ -0,0 +1,123 @@ +google.cloud.dialogflow.v2.AudioInput + */ +class AudioInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $config = null; + /** + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * + * Generated from protobuf field bytes audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $config + * Required. Instructs the speech recognizer how to process the speech audio. + * @type string $audio + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class); + $this->config = $var; + + return $this; + } + + /** + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * + * Generated from protobuf field bytes audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAudio() + { + return $this->audio; + } + + /** + * Required. The natural language speech audio to be processed. + * A single request can contain up to 2 minutes of speech audio data. + * The transcribed text cannot contain more than 256 bytes for virtual agent + * interactions. + * + * Generated from protobuf field bytes audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAudio($var) + { + GPBUtil::checkString($var, False); + $this->audio = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php new file mode 100644 index 000000000000..8b69234e2c43 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php @@ -0,0 +1,175 @@ +google.cloud.dialogflow.v2.AutomatedAgentConfig + */ +class AutomatedAgentConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $agent = ''; + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $session_ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * @type \Google\Protobuf\Duration $session_ttl + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getSessionTtl() + { + return $this->session_ttl; + } + + public function hasSessionTtl() + { + return isset($this->session_ttl); + } + + public function clearSessionTtl() + { + unset($this->session_ttl); + } + + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSessionTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->session_ttl = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php new file mode 100644 index 000000000000..5982d96d0122 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php @@ -0,0 +1,203 @@ +google.cloud.dialogflow.v2.AutomatedAgentReply + */ +class AutomatedAgentReply extends \Google\Protobuf\Internal\Message +{ + /** + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DetectIntentResponse detect_intent_response = 1; + */ + protected $detect_intent_response = null; + /** + * AutomatedAgentReply type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType automated_agent_reply_type = 7; + */ + protected $automated_agent_reply_type = 0; + /** + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * + * Generated from protobuf field bool allow_cancellation = 8; + */ + protected $allow_cancellation = false; + /** + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * + * Generated from protobuf field string cx_current_page = 11; + */ + protected $cx_current_page = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\DetectIntentResponse $detect_intent_response + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * @type int $automated_agent_reply_type + * AutomatedAgentReply type. + * @type bool $allow_cancellation + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * @type string $cx_current_page + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DetectIntentResponse detect_intent_response = 1; + * @return \Google\Cloud\Dialogflow\V2\DetectIntentResponse|null + */ + public function getDetectIntentResponse() + { + return $this->detect_intent_response; + } + + public function hasDetectIntentResponse() + { + return isset($this->detect_intent_response); + } + + public function clearDetectIntentResponse() + { + unset($this->detect_intent_response); + } + + /** + * Response of the Dialogflow + * [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] + * call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DetectIntentResponse detect_intent_response = 1; + * @param \Google\Cloud\Dialogflow\V2\DetectIntentResponse $var + * @return $this + */ + public function setDetectIntentResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DetectIntentResponse::class); + $this->detect_intent_response = $var; + + return $this; + } + + /** + * AutomatedAgentReply type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType automated_agent_reply_type = 7; + * @return int + */ + public function getAutomatedAgentReplyType() + { + return $this->automated_agent_reply_type; + } + + /** + * AutomatedAgentReply type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType automated_agent_reply_type = 7; + * @param int $var + * @return $this + */ + public function setAutomatedAgentReplyType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply\AutomatedAgentReplyType::class); + $this->automated_agent_reply_type = $var; + + return $this; + } + + /** + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * + * Generated from protobuf field bool allow_cancellation = 8; + * @return bool + */ + public function getAllowCancellation() + { + return $this->allow_cancellation; + } + + /** + * Indicates whether the partial automated agent reply is interruptible when a + * later reply message arrives. e.g. if the agent specified some music as + * partial response, it can be cancelled. + * + * Generated from protobuf field bool allow_cancellation = 8; + * @param bool $var + * @return $this + */ + public function setAllowCancellation($var) + { + GPBUtil::checkBool($var); + $this->allow_cancellation = $var; + + return $this; + } + + /** + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * + * Generated from protobuf field string cx_current_page = 11; + * @return string + */ + public function getCxCurrentPage() + { + return $this->cx_current_page; + } + + /** + * The unique identifier of the current Dialogflow CX conversation page. + * Format: `projects//locations//agents//flows//pages/`. + * + * Generated from protobuf field string cx_current_page = 11; + * @param string $var + * @return $this + */ + public function setCxCurrentPage($var) + { + GPBUtil::checkString($var, True); + $this->cx_current_page = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php new file mode 100644 index 000000000000..a9955f16b7d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType + */ +class AutomatedAgentReplyType +{ + /** + * Not specified. This should never happen. + * + * Generated from protobuf enum AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0; + */ + const AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0; + /** + * Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables + * `return_partial_response` can be returned as partial reply. + * WARNING: partial reply is not eligible for barge-in. + * + * Generated from protobuf enum PARTIAL = 1; + */ + const PARTIAL = 1; + /** + * Final reply. + * + * Generated from protobuf enum FINAL = 2; + */ + const PBFINAL = 2; + + private static $valueToName = [ + self::AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED => 'AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED', + self::PARTIAL => 'PARTIAL', + self::PBFINAL => 'FINAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchCreateEntitiesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchCreateEntitiesRequest.php new file mode 100644 index 000000000000..acec641d3b2b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchCreateEntitiesRequest.php @@ -0,0 +1,196 @@ +google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + */ +class BatchCreateEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The entities to create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entities; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $parent Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to create. + * + * @return \Google\Cloud\Dialogflow\V2\BatchCreateEntitiesRequest + * + * @experimental + */ + public static function build(string $parent, array $entities): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities); + } + + /** + * @param string $parent Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\BatchCreateEntitiesRequest + * + * @experimental + */ + public static function buildFromParentEntitiesLanguageCode(string $parent, array $entities, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * @type \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities + * Required. The entities to create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The entities to create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType\Entity> + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Required. The entities to create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntitiesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntitiesRequest.php new file mode 100644 index 000000000000..a0446412abbc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntitiesRequest.php @@ -0,0 +1,208 @@ +google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + */ +class BatchDeleteEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * Generated from protobuf field repeated string entity_values = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entity_values; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $parent Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string[] $entityValues Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteEntitiesRequest + * + * @experimental + */ + public static function build(string $parent, array $entityValues): self + { + return (new self()) + ->setParent($parent) + ->setEntityValues($entityValues); + } + + /** + * @param string $parent Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string[] $entityValues Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteEntitiesRequest + * + * @experimental + */ + public static function buildFromParentEntityValuesLanguageCode(string $parent, array $entityValues, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntityValues($entityValues) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * @type string[] $entity_values + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * Generated from protobuf field repeated string entity_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getEntityValues() + { + return $this->entity_values; + } + + /** + * Required. The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + * + * Generated from protobuf field repeated string entity_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setEntityValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entity_values = $arr; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntityTypesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntityTypesRequest.php new file mode 100644 index 000000000000..f1620c5707ea --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntityTypesRequest.php @@ -0,0 +1,128 @@ +google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + */ +class BatchDeleteEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * Generated from protobuf field repeated string entity_type_names = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entity_type_names; + + /** + * @param string $parent Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string[] $entityTypeNames Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteEntityTypesRequest + * + * @experimental + */ + public static function build(string $parent, array $entityTypeNames): self + { + return (new self()) + ->setParent($parent) + ->setEntityTypeNames($entityTypeNames); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @type string[] $entity_type_names + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * Generated from protobuf field repeated string entity_type_names = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getEntityTypeNames() + { + return $this->entity_type_names; + } + + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * + * Generated from protobuf field repeated string entity_type_names = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setEntityTypeNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entity_type_names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteIntentsRequest.php new file mode 100644 index 000000000000..bbae89ab6245 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteIntentsRequest.php @@ -0,0 +1,128 @@ +google.cloud.dialogflow.v2.BatchDeleteIntentsRequest + */ +class BatchDeleteIntentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $intents; + + /** + * @param string $parent Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Intent[] $intents Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * @return \Google\Cloud\Dialogflow\V2\BatchDeleteIntentsRequest + * + * @experimental + */ + public static function build(string $parent, array $intents): self + { + return (new self()) + ->setParent($parent) + ->setIntents($intents); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @type \Google\Cloud\Dialogflow\V2\Intent[] $intents + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent> + */ + public function getIntents() + { + return $this->intents; + } + + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent[] $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntitiesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntitiesRequest.php new file mode 100644 index 000000000000..acf0534f5682 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntitiesRequest.php @@ -0,0 +1,240 @@ +google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + */ +class BatchUpdateEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The entities to update or create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entities; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param string $parent Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to update or create. + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateEntitiesRequest + * + * @experimental + */ + public static function build(string $parent, array $entities): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities); + } + + /** + * @param string $parent Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities Required. The entities to update or create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateEntitiesRequest + * + * @experimental + */ + public static function buildFromParentEntitiesLanguageCode(string $parent, array $entities, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntities($entities) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * @type \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities + * Required. The entities to update or create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The entities to update or create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType\Entity> + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Required. The entities to update or create. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesRequest.php new file mode 100644 index 000000000000..4fee3c95945b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesRequest.php @@ -0,0 +1,250 @@ +google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + */ +class BatchUpdateEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + protected $entity_type_batch; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * @type string $entity_type_batch_uri + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + * @type \Google\Cloud\Dialogflow\V2\EntityTypeBatch $entity_type_batch_inline + * The collection of entity types to update or create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + * + * Generated from protobuf field string entity_type_batch_uri = 2; + * @return string + */ + public function getEntityTypeBatchUri() + { + return $this->readOneof(2); + } + + public function hasEntityTypeBatchUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + * + * Generated from protobuf field string entity_type_batch_uri = 2; + * @param string $var + * @return $this + */ + public function setEntityTypeBatchUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The collection of entity types to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityTypeBatch entity_type_batch_inline = 3; + * @return \Google\Cloud\Dialogflow\V2\EntityTypeBatch|null + */ + public function getEntityTypeBatchInline() + { + return $this->readOneof(3); + } + + public function hasEntityTypeBatchInline() + { + return $this->hasOneof(3); + } + + /** + * The collection of entity types to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityTypeBatch entity_type_batch_inline = 3; + * @param \Google\Cloud\Dialogflow\V2\EntityTypeBatch $var + * @return $this + */ + public function setEntityTypeBatchInline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityTypeBatch::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * @return string + */ + public function getEntityTypeBatch() + { + return $this->whichOneof("entity_type_batch"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesResponse.php new file mode 100644 index 000000000000..550d85294c2b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesResponse.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + */ +class BatchUpdateEntityTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The collection of updated or created entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + */ + private $entity_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EntityType[] $entity_types + * The collection of updated or created entity types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * The collection of updated or created entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType> + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * The collection of updated or created entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @param \Google\Cloud\Dialogflow\V2\EntityType[] $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsRequest.php new file mode 100644 index 000000000000..64ef05930b48 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsRequest.php @@ -0,0 +1,314 @@ +google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + */ +class BatchUpdateIntentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + protected $intent_batch; + + /** + * @param string $parent Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $intentBatchUri The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateIntentsRequest + * + * @experimental + */ + public static function build(string $parent, string $intentBatchUri): self + { + return (new self()) + ->setParent($parent) + ->setIntentBatchUri($intentBatchUri); + } + + /** + * @param string $parent Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\IntentBatch $intentBatchInline The collection of intents to update or create. + * + * @return \Google\Cloud\Dialogflow\V2\BatchUpdateIntentsRequest + * + * @experimental + */ + public static function buildFromParentIntentBatchInline(string $parent, \Google\Cloud\Dialogflow\V2\IntentBatch $intentBatchInline): self + { + return (new self()) + ->setParent($parent) + ->setIntentBatchInline($intentBatchInline); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * @type string $intent_batch_uri + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * @type \Google\Cloud\Dialogflow\V2\IntentBatch $intent_batch_inline + * The collection of intents to update or create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * + * Generated from protobuf field string intent_batch_uri = 2; + * @return string + */ + public function getIntentBatchUri() + { + return $this->readOneof(2); + } + + public function hasIntentBatchUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + * + * Generated from protobuf field string intent_batch_uri = 2; + * @param string $var + * @return $this + */ + public function setIntentBatchUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The collection of intents to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentBatch intent_batch_inline = 3; + * @return \Google\Cloud\Dialogflow\V2\IntentBatch|null + */ + public function getIntentBatchInline() + { + return $this->readOneof(3); + } + + public function hasIntentBatchInline() + { + return $this->hasOneof(3); + } + + /** + * The collection of intents to update or create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentBatch intent_batch_inline = 3; + * @param \Google\Cloud\Dialogflow\V2\IntentBatch $var + * @return $this + */ + public function setIntentBatchInline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentBatch::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + + /** + * @return string + */ + public function getIntentBatch() + { + return $this->whichOneof("intent_batch"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsResponse.php new file mode 100644 index 000000000000..b29757ffc206 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsResponse.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.BatchUpdateIntentsResponse + */ +class BatchUpdateIntentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The collection of updated or created intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + */ + private $intents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent[] $intents + * The collection of updated or created intents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The collection of updated or created intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent> + */ + public function getIntents() + { + return $this->intents; + } + + /** + * The collection of updated or created intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent[] $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesAppSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesAppSpec.php new file mode 100644 index 000000000000..27bb4b4a16dd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesAppSpec.php @@ -0,0 +1,217 @@ +google.cloud.dialogflow.v2.CesAppSpec + */ +class CesAppSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Format: `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $ces_app = ''; + /** + * Optional. Indicates whether the app requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confirmation_requirement = 0; + /** + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in proactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * + * Generated from protobuf field optional bool proactive_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $proactive_enabled = null; + /** + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in reactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * + * Generated from protobuf field optional bool reactive_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reactive_enabled = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ces_app + * Optional. Format: `projects//locations//apps/`. + * @type int $confirmation_requirement + * Optional. Indicates whether the app requires human confirmation. + * @type bool $proactive_enabled + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in proactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * @type bool $reactive_enabled + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in reactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\CesApp::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Format: `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesApp() + { + return $this->ces_app; + } + + /** + * Optional. Format: `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesApp($var) + { + GPBUtil::checkString($var, True); + $this->ces_app = $var; + + return $this; + } + + /** + * Optional. Indicates whether the app requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConfirmationRequirement() + { + return $this->confirmation_requirement; + } + + /** + * Optional. Indicates whether the app requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConfirmationRequirement($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\ConfirmationRequirement::class); + $this->confirmation_requirement = $var; + + return $this; + } + + /** + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in proactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * + * Generated from protobuf field optional bool proactive_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getProactiveEnabled() + { + return isset($this->proactive_enabled) ? $this->proactive_enabled : false; + } + + public function hasProactiveEnabled() + { + return isset($this->proactive_enabled); + } + + public function clearProactiveEnabled() + { + unset($this->proactive_enabled); + } + + /** + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in proactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * + * Generated from protobuf field optional bool proactive_enabled = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setProactiveEnabled($var) + { + GPBUtil::checkBool($var); + $this->proactive_enabled = $var; + + return $this; + } + + /** + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in reactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * + * Generated from protobuf field optional bool reactive_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getReactiveEnabled() + { + return isset($this->reactive_enabled) ? $this->reactive_enabled : false; + } + + public function hasReactiveEnabled() + { + return isset($this->reactive_enabled); + } + + public function clearReactiveEnabled() + { + unset($this->reactive_enabled); + } + + /** + * Optional. Only applicable for CompanionAgent. + * Indicates whether the ces app is enabled in reactive mode. + * At least one of `proactive_enabled` or `reactive_enabled` should be + * true; otherwise, the ces app will be ignored. + * + * Generated from protobuf field optional bool reactive_enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setReactiveEnabled($var) + { + GPBUtil::checkBool($var); + $this->reactive_enabled = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesToolSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesToolSpec.php new file mode 100644 index 000000000000..5e276ffa60c1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CesToolSpec.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.CesToolSpec + */ +class CesToolSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Format: `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $ces_tool = ''; + /** + * Optional. Indicates whether the tool requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confirmation_requirement = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ces_tool + * Optional. Format: `projects//locations//apps//tools/`. + * @type int $confirmation_requirement + * Optional. Indicates whether the tool requires human confirmation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\CesTool::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Format: `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesTool() + { + return $this->ces_tool; + } + + /** + * Optional. Format: `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesTool($var) + { + GPBUtil::checkString($var, True); + $this->ces_tool = $var; + + return $this; + } + + /** + * Optional. Indicates whether the tool requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConfirmationRequirement() + { + return $this->confirmation_requirement; + } + + /** + * Optional. Indicates whether the tool requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConfirmationRequirement($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\ConfirmationRequirement::class); + $this->confirmation_requirement = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php new file mode 100644 index 000000000000..51413a87adf7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php @@ -0,0 +1,193 @@ +google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata + */ +class ClearSuggestionFeatureConfigOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_type = 0; + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * @type int $participant_role + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type int $suggestion_feature_type + * Required. The type of the suggestion feature to remove. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp whe the request was created. The time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSuggestionFeatureType() + { + return $this->suggestion_feature_type; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSuggestionFeatureType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->suggestion_feature_type = $var; + + return $this; + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php new file mode 100644 index 000000000000..5f7d739a2133 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php @@ -0,0 +1,185 @@ +google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest + */ +class ClearSuggestionFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_type = 0; + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * @return \Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function build(string $conversationProfile): self + { + return (new self()) + ->setConversationProfile($conversationProfile); + } + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @param int $participantRole Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\Participant\Role} + * @param int $suggestionFeatureType Required. The type of the suggestion feature to remove. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type} + * + * @return \Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function buildFromConversationProfileParticipantRoleSuggestionFeatureType(string $conversationProfile, int $participantRole, int $suggestionFeatureType): self + { + return (new self()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @type int $participant_role + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type int $suggestion_feature_type + * Required. The type of the suggestion feature to remove. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSuggestionFeatureType() + { + return $this->suggestion_feature_type; + } + + /** + * Required. The type of the suggestion feature to remove. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSuggestionFeatureType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->suggestion_feature_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php new file mode 100644 index 000000000000..fa0a3a43f746 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php @@ -0,0 +1,750 @@ +google.cloud.dialogflow.v2.CloudConversationDebuggingInfo + */ +class CloudConversationDebuggingInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + */ + protected $audio_data_chunks = 0; + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + */ + protected $result_end_time_offset = null; + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + */ + protected $first_audio_duration = null; + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + */ + protected $single_utterance = false; + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + */ + private $speech_partial_results_end_times; + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + */ + private $speech_final_results_end_times; + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + */ + protected $partial_responses = 0; + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + */ + protected $speaker_id_passive_latency_ms_offset = 0; + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + */ + protected $bargein_event_triggered = false; + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + */ + protected $speech_single_utterance = false; + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + */ + private $dtmf_partial_results_times; + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + */ + private $dtmf_final_results_times; + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + */ + protected $single_utterance_end_time_offset = null; + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + */ + protected $no_speech_timeout = null; + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + */ + protected $endpointing_timeout = null; + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + */ + protected $is_input_text = false; + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + */ + protected $client_half_close_time_offset = null; + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + */ + protected $client_half_close_streaming_time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_data_chunks + * Number of input audio data chunks in streaming requests. + * @type \Google\Protobuf\Duration $result_end_time_offset + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * @type \Google\Protobuf\Duration $first_audio_duration + * Duration of first audio chunk. + * @type bool $single_utterance + * Whether client used single utterance mode. + * @type \Google\Protobuf\Duration[] $speech_partial_results_end_times + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * @type \Google\Protobuf\Duration[] $speech_final_results_end_times + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * @type int $partial_responses + * Total number of partial responses. + * @type int $speaker_id_passive_latency_ms_offset + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * @type bool $bargein_event_triggered + * Whether a barge-in event is triggered in this request. + * @type bool $speech_single_utterance + * Whether speech uses single utterance mode. + * @type \Google\Protobuf\Duration[] $dtmf_partial_results_times + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * @type \Google\Protobuf\Duration[] $dtmf_final_results_times + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * @type \Google\Protobuf\Duration $single_utterance_end_time_offset + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * @type \Google\Protobuf\Duration $no_speech_timeout + * No speech timeout settings for the stream. + * @type \Google\Protobuf\Duration $endpointing_timeout + * Speech endpointing timeout settings for the stream. + * @type bool $is_input_text + * Whether the streaming terminates with an injected text query. + * @type \Google\Protobuf\Duration $client_half_close_time_offset + * Client half close time in terms of input audio duration. + * @type \Google\Protobuf\Duration $client_half_close_streaming_time_offset + * Client half close time in terms of API streaming duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + * @return int + */ + public function getAudioDataChunks() + { + return $this->audio_data_chunks; + } + + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + * @param int $var + * @return $this + */ + public function setAudioDataChunks($var) + { + GPBUtil::checkInt32($var); + $this->audio_data_chunks = $var; + + return $this; + } + + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getResultEndTimeOffset() + { + return $this->result_end_time_offset; + } + + public function hasResultEndTimeOffset() + { + return isset($this->result_end_time_offset); + } + + public function clearResultEndTimeOffset() + { + unset($this->result_end_time_offset); + } + + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setResultEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->result_end_time_offset = $var; + + return $this; + } + + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getFirstAudioDuration() + { + return $this->first_audio_duration; + } + + public function hasFirstAudioDuration() + { + return isset($this->first_audio_duration); + } + + public function clearFirstAudioDuration() + { + unset($this->first_audio_duration); + } + + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFirstAudioDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->first_audio_duration = $var; + + return $this; + } + + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + * @return bool + */ + public function getSingleUtterance() + { + return $this->single_utterance; + } + + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + * @param bool $var + * @return $this + */ + public function setSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + * @return RepeatedField<\Google\Protobuf\Duration> + */ + public function getSpeechPartialResultsEndTimes() + { + return $this->speech_partial_results_end_times; + } + + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + * @param \Google\Protobuf\Duration[] $var + * @return $this + */ + public function setSpeechPartialResultsEndTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->speech_partial_results_end_times = $arr; + + return $this; + } + + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + * @return RepeatedField<\Google\Protobuf\Duration> + */ + public function getSpeechFinalResultsEndTimes() + { + return $this->speech_final_results_end_times; + } + + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + * @param \Google\Protobuf\Duration[] $var + * @return $this + */ + public function setSpeechFinalResultsEndTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->speech_final_results_end_times = $arr; + + return $this; + } + + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + * @return int + */ + public function getPartialResponses() + { + return $this->partial_responses; + } + + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + * @param int $var + * @return $this + */ + public function setPartialResponses($var) + { + GPBUtil::checkInt32($var); + $this->partial_responses = $var; + + return $this; + } + + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + * @return int + */ + public function getSpeakerIdPassiveLatencyMsOffset() + { + return $this->speaker_id_passive_latency_ms_offset; + } + + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + * @param int $var + * @return $this + */ + public function setSpeakerIdPassiveLatencyMsOffset($var) + { + GPBUtil::checkInt32($var); + $this->speaker_id_passive_latency_ms_offset = $var; + + return $this; + } + + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + * @return bool + */ + public function getBargeinEventTriggered() + { + return $this->bargein_event_triggered; + } + + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + * @param bool $var + * @return $this + */ + public function setBargeinEventTriggered($var) + { + GPBUtil::checkBool($var); + $this->bargein_event_triggered = $var; + + return $this; + } + + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + * @return bool + */ + public function getSpeechSingleUtterance() + { + return $this->speech_single_utterance; + } + + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + * @param bool $var + * @return $this + */ + public function setSpeechSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->speech_single_utterance = $var; + + return $this; + } + + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + * @return RepeatedField<\Google\Protobuf\Duration> + */ + public function getDtmfPartialResultsTimes() + { + return $this->dtmf_partial_results_times; + } + + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + * @param \Google\Protobuf\Duration[] $var + * @return $this + */ + public function setDtmfPartialResultsTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->dtmf_partial_results_times = $arr; + + return $this; + } + + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + * @return RepeatedField<\Google\Protobuf\Duration> + */ + public function getDtmfFinalResultsTimes() + { + return $this->dtmf_final_results_times; + } + + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + * @param \Google\Protobuf\Duration[] $var + * @return $this + */ + public function setDtmfFinalResultsTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->dtmf_final_results_times = $arr; + + return $this; + } + + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + * @return \Google\Protobuf\Duration|null + */ + public function getSingleUtteranceEndTimeOffset() + { + return $this->single_utterance_end_time_offset; + } + + public function hasSingleUtteranceEndTimeOffset() + { + return isset($this->single_utterance_end_time_offset); + } + + public function clearSingleUtteranceEndTimeOffset() + { + unset($this->single_utterance_end_time_offset); + } + + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSingleUtteranceEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->single_utterance_end_time_offset = $var; + + return $this; + } + + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + * @return \Google\Protobuf\Duration|null + */ + public function getNoSpeechTimeout() + { + return $this->no_speech_timeout; + } + + public function hasNoSpeechTimeout() + { + return isset($this->no_speech_timeout); + } + + public function clearNoSpeechTimeout() + { + unset($this->no_speech_timeout); + } + + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setNoSpeechTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->no_speech_timeout = $var; + + return $this; + } + + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + * @return \Google\Protobuf\Duration|null + */ + public function getEndpointingTimeout() + { + return $this->endpointing_timeout; + } + + public function hasEndpointingTimeout() + { + return isset($this->endpointing_timeout); + } + + public function clearEndpointingTimeout() + { + unset($this->endpointing_timeout); + } + + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndpointingTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->endpointing_timeout = $var; + + return $this; + } + + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + * @return bool + */ + public function getIsInputText() + { + return $this->is_input_text; + } + + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + * @param bool $var + * @return $this + */ + public function setIsInputText($var) + { + GPBUtil::checkBool($var); + $this->is_input_text = $var; + + return $this; + } + + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + * @return \Google\Protobuf\Duration|null + */ + public function getClientHalfCloseTimeOffset() + { + return $this->client_half_close_time_offset; + } + + public function hasClientHalfCloseTimeOffset() + { + return isset($this->client_half_close_time_offset); + } + + public function clearClientHalfCloseTimeOffset() + { + unset($this->client_half_close_time_offset); + } + + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setClientHalfCloseTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->client_half_close_time_offset = $var; + + return $this; + } + + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + * @return \Google\Protobuf\Duration|null + */ + public function getClientHalfCloseStreamingTimeOffset() + { + return $this->client_half_close_streaming_time_offset; + } + + public function hasClientHalfCloseStreamingTimeOffset() + { + return isset($this->client_half_close_streaming_time_offset); + } + + public function clearClientHalfCloseStreamingTimeOffset() + { + unset($this->client_half_close_streaming_time_offset); + } + + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setClientHalfCloseStreamingTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->client_half_close_streaming_time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php new file mode 100644 index 000000000000..a3276eef602c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.CompleteConversationRequest + */ +class CompleteConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\CompleteConversationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection.php new file mode 100644 index 000000000000..e9fbfb129c6e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection.php @@ -0,0 +1,193 @@ +google.cloud.dialogflow.v2.Connection + */ +class Connection extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of the SIP Trunk connection. + * + * Generated from protobuf field string connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $connection_id = ''; + /** + * Output only. State of the connection. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Connection.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. When the connection status changed. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The error details for the connection. Only populated when + * authentication errors occur. + * + * Generated from protobuf field optional .google.cloud.dialogflow.v2.Connection.ErrorDetails error_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error_details = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection_id + * Output only. The unique identifier of the SIP Trunk connection. + * @type int $state + * Output only. State of the connection. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the connection status changed. + * @type \Google\Cloud\Dialogflow\V2\Connection\ErrorDetails $error_details + * Output only. The error details for the connection. Only populated when + * authentication errors occur. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of the SIP Trunk connection. + * + * Generated from protobuf field string connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getConnectionId() + { + return $this->connection_id; + } + + /** + * Output only. The unique identifier of the SIP Trunk connection. + * + * Generated from protobuf field string connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->connection_id = $var; + + return $this; + } + + /** + * Output only. State of the connection. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Connection.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the connection. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Connection.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Connection\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. When the connection status changed. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the connection status changed. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The error details for the connection. Only populated when + * authentication errors occur. + * + * Generated from protobuf field optional .google.cloud.dialogflow.v2.Connection.ErrorDetails error_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\Connection\ErrorDetails|null + */ + public function getErrorDetails() + { + return $this->error_details; + } + + public function hasErrorDetails() + { + return isset($this->error_details); + } + + public function clearErrorDetails() + { + unset($this->error_details); + } + + /** + * Output only. The error details for the connection. Only populated when + * authentication errors occur. + * + * Generated from protobuf field optional .google.cloud.dialogflow.v2.Connection.ErrorDetails error_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Connection\ErrorDetails $var + * @return $this + */ + public function setErrorDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Connection\ErrorDetails::class); + $this->error_details = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/CertificateState.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/CertificateState.php new file mode 100644 index 000000000000..f7a026978e27 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/CertificateState.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.Connection.CertificateState + */ +class CertificateState +{ + /** + * Certificate state is not specified. + * + * Generated from protobuf enum CERTIFICATE_STATE_UNSPECIFIED = 0; + */ + const CERTIFICATE_STATE_UNSPECIFIED = 0; + /** + * Certificate is valid. + * + * Generated from protobuf enum CERTIFICATE_VALID = 1; + */ + const CERTIFICATE_VALID = 1; + /** + * Catch all for any error not specified. + * + * Generated from protobuf enum CERTIFICATE_INVALID = 2; + */ + const CERTIFICATE_INVALID = 2; + /** + * Certificate leaf node has expired. + * + * Generated from protobuf enum CERTIFICATE_EXPIRED = 3; + */ + const CERTIFICATE_EXPIRED = 3; + /** + * There is no hostname defined to authenticate in SipTrunkingServer. + * + * Generated from protobuf enum CERTIFICATE_HOSTNAME_NOT_FOUND = 4; + */ + const CERTIFICATE_HOSTNAME_NOT_FOUND = 4; + /** + * No path found from the leaf certificate to any root. + * + * Generated from protobuf enum CERTIFICATE_UNAUTHENTICATED = 5; + */ + const CERTIFICATE_UNAUTHENTICATED = 5; + /** + * Trust store does not exist. + * + * Generated from protobuf enum CERTIFICATE_TRUST_STORE_NOT_FOUND = 6; + */ + const CERTIFICATE_TRUST_STORE_NOT_FOUND = 6; + /** + * Hostname has invalid format. + * + * Generated from protobuf enum CERTIFICATE_HOSTNAME_INVALID_FORMAT = 7; + */ + const CERTIFICATE_HOSTNAME_INVALID_FORMAT = 7; + /** + * Certificate has exhausted its quota. + * + * Generated from protobuf enum CERTIFICATE_QUOTA_EXCEEDED = 8; + */ + const CERTIFICATE_QUOTA_EXCEEDED = 8; + + private static $valueToName = [ + self::CERTIFICATE_STATE_UNSPECIFIED => 'CERTIFICATE_STATE_UNSPECIFIED', + self::CERTIFICATE_VALID => 'CERTIFICATE_VALID', + self::CERTIFICATE_INVALID => 'CERTIFICATE_INVALID', + self::CERTIFICATE_EXPIRED => 'CERTIFICATE_EXPIRED', + self::CERTIFICATE_HOSTNAME_NOT_FOUND => 'CERTIFICATE_HOSTNAME_NOT_FOUND', + self::CERTIFICATE_UNAUTHENTICATED => 'CERTIFICATE_UNAUTHENTICATED', + self::CERTIFICATE_TRUST_STORE_NOT_FOUND => 'CERTIFICATE_TRUST_STORE_NOT_FOUND', + self::CERTIFICATE_HOSTNAME_INVALID_FORMAT => 'CERTIFICATE_HOSTNAME_INVALID_FORMAT', + self::CERTIFICATE_QUOTA_EXCEEDED => 'CERTIFICATE_QUOTA_EXCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/ErrorDetails.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/ErrorDetails.php new file mode 100644 index 000000000000..509cdd420ac0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/ErrorDetails.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.Connection.ErrorDetails + */ +class ErrorDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The status of the certificate authentication. + * + * Generated from protobuf field optional .google.cloud.dialogflow.v2.Connection.CertificateState certificate_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $certificate_state = null; + /** + * The error message provided from SIP trunking auth service + * + * Generated from protobuf field optional string error_message = 2; + */ + protected $error_message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $certificate_state + * Output only. The status of the certificate authentication. + * @type string $error_message + * The error message provided from SIP trunking auth service + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The status of the certificate authentication. + * + * Generated from protobuf field optional .google.cloud.dialogflow.v2.Connection.CertificateState certificate_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCertificateState() + { + return isset($this->certificate_state) ? $this->certificate_state : 0; + } + + public function hasCertificateState() + { + return isset($this->certificate_state); + } + + public function clearCertificateState() + { + unset($this->certificate_state); + } + + /** + * Output only. The status of the certificate authentication. + * + * Generated from protobuf field optional .google.cloud.dialogflow.v2.Connection.CertificateState certificate_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCertificateState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Connection\CertificateState::class); + $this->certificate_state = $var; + + return $this; + } + + /** + * The error message provided from SIP trunking auth service + * + * Generated from protobuf field optional string error_message = 2; + * @return string + */ + public function getErrorMessage() + { + return isset($this->error_message) ? $this->error_message : ''; + } + + public function hasErrorMessage() + { + return isset($this->error_message); + } + + public function clearErrorMessage() + { + unset($this->error_message); + } + + /** + * The error message provided from SIP trunking auth service + * + * Generated from protobuf field optional string error_message = 2; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/State.php new file mode 100644 index 000000000000..9bfd6f574389 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Connection/State.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.Connection.State + */ +class State +{ + /** + * SIP Trunk connection state is Not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * SIP Trunk connection is connected. + * + * Generated from protobuf enum CONNECTED = 1; + */ + const CONNECTED = 1; + /** + * SIP Trunk connection is disconnected. + * + * Generated from protobuf enum DISCONNECTED = 2; + */ + const DISCONNECTED = 2; + /** + * SIP Trunk connection has authentication error. + * + * Generated from protobuf enum AUTHENTICATION_FAILED = 3; + */ + const AUTHENTICATION_FAILED = 3; + /** + * SIP Trunk connection is keepalive. + * + * Generated from protobuf enum KEEPALIVE = 4; + */ + const KEEPALIVE = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CONNECTED => 'CONNECTED', + self::DISCONNECTED => 'DISCONNECTED', + self::AUTHENTICATION_FAILED => 'AUTHENTICATION_FAILED', + self::KEEPALIVE => 'KEEPALIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php new file mode 100644 index 000000000000..3927efc636ac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php @@ -0,0 +1,261 @@ +google.cloud.dialogflow.v2.Context + */ +class Context extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $lifespan_count = 0; + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * @type int $lifespan_count + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * @type \Google\Protobuf\Struct $parameters + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLifespanCount() + { + return $this->lifespan_count; + } + + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLifespanCount($var) + { + GPBUtil::checkInt32($var); + $this->lifespan_count = $var; + + return $this; + } + + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php new file mode 100644 index 000000000000..835c58728459 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php @@ -0,0 +1,548 @@ +google.cloud.dialogflow.v2.Conversation + */ +class Conversation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $lifecycle_state = 0; + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation_profile = ''; + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_number = null; + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_stage = 0; + /** + * Output only. The telephony connection information. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $telephony_connection_info = null; + /** + * Optional. Output only. The initial conversation profile to be used to + * configure this conversation, which is a copy of the conversation profile + * config read at conversation creation time. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile initial_conversation_profile = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $initial_conversation_profile = null; + /** + * Output only. The context reference updates provided by external systems. + * + * Generated from protobuf field map ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $ingested_context_references; + /** + * Output only. A map with generator name as key and generator context as + * value. + * + * Generated from protobuf field map initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $initial_generator_contexts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * @type int $lifecycle_state + * Output only. The current state of the Conversation. + * @type string $conversation_profile + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * @type \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $phone_number + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time the conversation was started. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the conversation was finished. + * @type int $conversation_stage + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * @type \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo $telephony_connection_info + * Output only. The telephony connection information. + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $initial_conversation_profile + * Optional. Output only. The initial conversation profile to be used to + * configure this conversation, which is a copy of the conversation profile + * config read at conversation creation time. + * @type array|\Google\Protobuf\Internal\MapField $ingested_context_references + * Output only. The context reference updates provided by external systems. + * @type array|\Google\Protobuf\Internal\MapField $initial_generator_contexts + * Output only. A map with generator name as key and generator context as + * value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLifecycleState() + { + return $this->lifecycle_state; + } + + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLifecycleState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\LifecycleState::class); + $this->lifecycle_state = $var; + + return $this; + } + + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber|null + */ + public function getPhoneNumber() + { + return $this->phone_number; + } + + public function hasPhoneNumber() + { + return isset($this->phone_number); + } + + public function clearPhoneNumber() + { + unset($this->phone_number); + } + + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber::class); + $this->phone_number = $var; + + return $this; + } + + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConversationStage() + { + return $this->conversation_stage; + } + + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConversationStage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ConversationStage::class); + $this->conversation_stage = $var; + + return $this; + } + + /** + * Output only. The telephony connection information. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo|null + */ + public function getTelephonyConnectionInfo() + { + return $this->telephony_connection_info; + } + + public function hasTelephonyConnectionInfo() + { + return isset($this->telephony_connection_info); + } + + public function clearTelephonyConnectionInfo() + { + unset($this->telephony_connection_info); + } + + /** + * Output only. The telephony connection information. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo $var + * @return $this + */ + public function setTelephonyConnectionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo::class); + $this->telephony_connection_info = $var; + + return $this; + } + + /** + * Optional. Output only. The initial conversation profile to be used to + * configure this conversation, which is a copy of the conversation profile + * config read at conversation creation time. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile initial_conversation_profile = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getInitialConversationProfile() + { + return $this->initial_conversation_profile; + } + + public function hasInitialConversationProfile() + { + return isset($this->initial_conversation_profile); + } + + public function clearInitialConversationProfile() + { + unset($this->initial_conversation_profile); + } + + /** + * Optional. Output only. The initial conversation profile to be used to + * configure this conversation, which is a copy of the conversation profile + * config read at conversation creation time. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile initial_conversation_profile = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setInitialConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->initial_conversation_profile = $var; + + return $this; + } + + /** + * Output only. The context reference updates provided by external systems. + * + * Generated from protobuf field map ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getIngestedContextReferences() + { + return $this->ingested_context_references; + } + + /** + * Output only. The context reference updates provided by external systems. + * + * Generated from protobuf field map ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setIngestedContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->ingested_context_references = $arr; + + return $this; + } + + /** + * Output only. A map with generator name as key and generator context as + * value. + * + * Generated from protobuf field map initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInitialGeneratorContexts() + { + return $this->initial_generator_contexts; + } + + /** + * Output only. A map with generator name as key and generator context as + * value. + * + * Generated from protobuf field map initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInitialGeneratorContexts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\GeneratorContext::class); + $this->initial_generator_contexts = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference.php new file mode 100644 index 000000000000..b4bea66dc7d6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference.php @@ -0,0 +1,183 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference + */ +class ContextReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of content updates for a context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent context_contents = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $context_contents; + /** + * Required. The mode in which context reference contents are updated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode update_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mode = 0; + /** + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Output only. The time the context reference was first created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent[] $context_contents + * Required. The list of content updates for a context reference. + * @type int $update_mode + * Required. The mode in which context reference contents are updated. + * @type string $language_code + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the context reference was first created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of content updates for a context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent context_contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent> + */ + public function getContextContents() + { + return $this->context_contents; + } + + /** + * Required. The list of content updates for a context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent context_contents = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent[] $var + * @return $this + */ + public function setContextContents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent::class); + $this->context_contents = $arr; + + return $this; + } + + /** + * Required. The mode in which context reference contents are updated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode update_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getUpdateMode() + { + return $this->update_mode; + } + + /** + * Required. The mode in which context reference contents are updated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode update_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setUpdateMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\UpdateMode::class); + $this->update_mode = $var; + + return $this; + } + + /** + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language of the information ingested, defaults to "en-US" + * if not set. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Output only. The time the context reference was first created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the context reference was first created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent.php new file mode 100644 index 000000000000..8bc2f406dddb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent.php @@ -0,0 +1,195 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent + */ +class ContextContent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The information ingested in a single request. + * + * Generated from protobuf field string content = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content = ''; + /** + * Required. The format of the ingested string. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content_format = 0; + /** + * Output only. The time when this information was incorporated into the + * relevant context reference. + * + * Generated from protobuf field .google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ingestion_time = null; + /** + * If the context content was generated from a tool call, specify the + * answer record associated with the tool call. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string answer_record = 4; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Required. The information ingested in a single request. + * @type int $content_format + * Required. The format of the ingested string. + * @type \Google\Protobuf\Timestamp $ingestion_time + * Output only. The time when this information was incorporated into the + * relevant context reference. + * @type string $answer_record + * If the context content was generated from a tool call, specify the + * answer record associated with the tool call. + * Format: `projects//locations//answerRecords/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The information ingested in a single request. + * + * Generated from protobuf field string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Required. The information ingested in a single request. + * + * Generated from protobuf field string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Required. The format of the ingested string. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getContentFormat() + { + return $this->content_format; + } + + /** + * Required. The format of the ingested string. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat content_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setContentFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent\ContentFormat::class); + $this->content_format = $var; + + return $this; + } + + /** + * Output only. The time when this information was incorporated into the + * relevant context reference. + * + * Generated from protobuf field .google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getIngestionTime() + { + return $this->ingestion_time; + } + + public function hasIngestionTime() + { + return isset($this->ingestion_time); + } + + public function clearIngestionTime() + { + unset($this->ingestion_time); + } + + /** + * Output only. The time when this information was incorporated into the + * relevant context reference. + * + * Generated from protobuf field .google.protobuf.Timestamp ingestion_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setIngestionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->ingestion_time = $var; + + return $this; + } + + /** + * If the context content was generated from a tool call, specify the + * answer record associated with the tool call. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string answer_record = 4; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * If the context content was generated from a tool call, specify the + * answer record associated with the tool call. + * Format: `projects//locations//answerRecords/`. + * + * Generated from protobuf field string answer_record = 4; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent/ContentFormat.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent/ContentFormat.php new file mode 100644 index 000000000000..6bd10592fed0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/ContextContent/ContentFormat.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat + */ +class ContentFormat +{ + /** + * Unspecified content format. + * + * Generated from protobuf enum CONTENT_FORMAT_UNSPECIFIED = 0; + */ + const CONTENT_FORMAT_UNSPECIFIED = 0; + /** + * Content was provided in JSON format. + * + * Generated from protobuf enum JSON = 1; + */ + const JSON = 1; + /** + * Content was provided as plain text. + * + * Generated from protobuf enum PLAIN_TEXT = 2; + */ + const PLAIN_TEXT = 2; + + private static $valueToName = [ + self::CONTENT_FORMAT_UNSPECIFIED => 'CONTENT_FORMAT_UNSPECIFIED', + self::JSON => 'JSON', + self::PLAIN_TEXT => 'PLAIN_TEXT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/UpdateMode.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/UpdateMode.php new file mode 100644 index 000000000000..f310b766b66f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ContextReference/UpdateMode.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode + */ +class UpdateMode +{ + /** + * Unspecified update mode. + * + * Generated from protobuf enum UPDATE_MODE_UNSPECIFIED = 0; + */ + const UPDATE_MODE_UNSPECIFIED = 0; + /** + * Context content updates are applied in append mode. + * + * Generated from protobuf enum APPEND = 1; + */ + const APPEND = 1; + /** + * Context content updates are applied in overwrite mode. + * + * Generated from protobuf enum OVERWRITE = 2; + */ + const OVERWRITE = 2; + + private static $valueToName = [ + self::UPDATE_MODE_UNSPECIFIED => 'UPDATE_MODE_UNSPECIFIED', + self::APPEND => 'APPEND', + self::OVERWRITE => 'OVERWRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php new file mode 100644 index 000000000000..14df00a3c9b5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php @@ -0,0 +1,66 @@ +google.cloud.dialogflow.v2.Conversation.ConversationStage + */ +class ConversationStage +{ + /** + * Unknown. Should never be used after a conversation is successfully + * created. + * + * Generated from protobuf enum CONVERSATION_STAGE_UNSPECIFIED = 0; + */ + const CONVERSATION_STAGE_UNSPECIFIED = 0; + /** + * The conversation should return virtual agent responses into the + * conversation. + * + * Generated from protobuf enum VIRTUAL_AGENT_STAGE = 1; + */ + const VIRTUAL_AGENT_STAGE = 1; + /** + * The conversation should not provide responses, just listen and provide + * suggestions. + * + * Generated from protobuf enum HUMAN_ASSIST_STAGE = 2; + */ + const HUMAN_ASSIST_STAGE = 2; + + private static $valueToName = [ + self::CONVERSATION_STAGE_UNSPECIFIED => 'CONVERSATION_STAGE_UNSPECIFIED', + self::VIRTUAL_AGENT_STAGE => 'VIRTUAL_AGENT_STAGE', + self::HUMAN_ASSIST_STAGE => 'HUMAN_ASSIST_STAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext.php new file mode 100644 index 000000000000..ea046c4cff67 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Conversation.GeneratorContext + */ +class GeneratorContext extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The type of the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorType generator_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generator_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $generator_type + * Output only. The type of the generator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The type of the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorType generator_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getGeneratorType() + { + return $this->generator_type; + } + + /** + * Output only. The type of the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorType generator_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setGeneratorType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\GeneratorContext\GeneratorType::class); + $this->generator_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext/GeneratorType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext/GeneratorType.php new file mode 100644 index 000000000000..9c0c3650cffc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/GeneratorContext/GeneratorType.php @@ -0,0 +1,89 @@ +google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorType + */ +class GeneratorType +{ + /** + * Unspecified generator type. + * + * Generated from protobuf enum GENERATOR_TYPE_UNSPECIFIED = 0; + */ + const GENERATOR_TYPE_UNSPECIFIED = 0; + /** + * Free form generator type. + * + * Generated from protobuf enum FREE_FORM = 1; + */ + const FREE_FORM = 1; + /** + * Agent coaching generator type. + * + * Generated from protobuf enum AGENT_COACHING = 2; + */ + const AGENT_COACHING = 2; + /** + * Summarization generator type. + * + * Generated from protobuf enum SUMMARIZATION = 3; + */ + const SUMMARIZATION = 3; + /** + * Translation generator type. + * + * Generated from protobuf enum TRANSLATION = 4; + */ + const TRANSLATION = 4; + /** + * Agent feedback generator type. + * + * Generated from protobuf enum AGENT_FEEDBACK = 5; + */ + const AGENT_FEEDBACK = 5; + /** + * Customer message generation generator type. + * + * Generated from protobuf enum CUSTOMER_MESSAGE_GENERATION = 6; + */ + const CUSTOMER_MESSAGE_GENERATION = 6; + + private static $valueToName = [ + self::GENERATOR_TYPE_UNSPECIFIED => 'GENERATOR_TYPE_UNSPECIFIED', + self::FREE_FORM => 'FREE_FORM', + self::AGENT_COACHING => 'AGENT_COACHING', + self::SUMMARIZATION => 'SUMMARIZATION', + self::TRANSLATION => 'TRANSLATION', + self::AGENT_FEEDBACK => 'AGENT_FEEDBACK', + self::CUSTOMER_MESSAGE_GENERATION => 'CUSTOMER_MESSAGE_GENERATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php new file mode 100644 index 000000000000..3f9de1c07b44 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.Conversation.LifecycleState + */ +class LifecycleState +{ + /** + * Unknown. + * + * Generated from protobuf enum LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + const LIFECYCLE_STATE_UNSPECIFIED = 0; + /** + * Conversation is currently open for media analysis. + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + /** + * Conversation has been completed. + * + * Generated from protobuf enum COMPLETED = 2; + */ + const COMPLETED = 2; + + private static $valueToName = [ + self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::COMPLETED => 'COMPLETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo.php new file mode 100644 index 000000000000..db908205145c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo.php @@ -0,0 +1,178 @@ +google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo + */ +class TelephonyConnectionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The number dialed to connect this call in E.164 format. + * + * Generated from protobuf field string dialed_number = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $dialed_number = ''; + /** + * Optional. SDP of the call. It's initially the SDP answer to the incoming + * call, but maybe later updated for the purpose of making the link active, + * etc. + * + * Generated from protobuf field string sdp = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sdp = ''; + /** + * Output only. The SIP headers from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader sip_headers = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $sip_headers; + /** + * Output only. The mime content from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent extra_mime_contents = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $extra_mime_contents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dialed_number + * Output only. The number dialed to connect this call in E.164 format. + * @type string $sdp + * Optional. SDP of the call. It's initially the SDP answer to the incoming + * call, but maybe later updated for the purpose of making the link active, + * etc. + * @type \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader[] $sip_headers + * Output only. The SIP headers from the initial SIP INVITE. + * @type \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent[] $extra_mime_contents + * Output only. The mime content from the initial SIP INVITE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The number dialed to connect this call in E.164 format. + * + * Generated from protobuf field string dialed_number = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDialedNumber() + { + return $this->dialed_number; + } + + /** + * Output only. The number dialed to connect this call in E.164 format. + * + * Generated from protobuf field string dialed_number = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDialedNumber($var) + { + GPBUtil::checkString($var, True); + $this->dialed_number = $var; + + return $this; + } + + /** + * Optional. SDP of the call. It's initially the SDP answer to the incoming + * call, but maybe later updated for the purpose of making the link active, + * etc. + * + * Generated from protobuf field string sdp = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSdp() + { + return $this->sdp; + } + + /** + * Optional. SDP of the call. It's initially the SDP answer to the incoming + * call, but maybe later updated for the purpose of making the link active, + * etc. + * + * Generated from protobuf field string sdp = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSdp($var) + { + GPBUtil::checkString($var, True); + $this->sdp = $var; + + return $this; + } + + /** + * Output only. The SIP headers from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader sip_headers = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader> + */ + public function getSipHeaders() + { + return $this->sip_headers; + } + + /** + * Output only. The SIP headers from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader sip_headers = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader[] $var + * @return $this + */ + public function setSipHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\SipHeader::class); + $this->sip_headers = $arr; + + return $this; + } + + /** + * Output only. The mime content from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent extra_mime_contents = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent> + */ + public function getExtraMimeContents() + { + return $this->extra_mime_contents; + } + + /** + * Output only. The mime content from the initial SIP INVITE. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent extra_mime_contents = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent[] $var + * @return $this + */ + public function setExtraMimeContents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\TelephonyConnectionInfo\MimeContent::class); + $this->extra_mime_contents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/MimeContent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/MimeContent.php new file mode 100644 index 000000000000..4b4a241fce85 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/MimeContent.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent + */ +class MimeContent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The mime type of the content. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mime_type = ''; + /** + * Optional. The content payload. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mime_type + * Optional. The mime type of the content. + * @type string $content + * Optional. The content payload. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The mime type of the content. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Optional. The mime type of the content. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Optional. The content payload. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Optional. The content payload. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, False); + $this->content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/SipHeader.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/SipHeader.php new file mode 100644 index 000000000000..54b9b4aa9834 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/TelephonyConnectionInfo/SipHeader.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader + */ +class SipHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the header. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The value of the header. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the header. + * @type string $value + * Optional. The value of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the header. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the header. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The value of the header. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The value of the header. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php new file mode 100644 index 000000000000..e12f4879f8be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ConversationContext + */ +class ConversationContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $message_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\MessageEntry[] $message_entries + * Optional. List of message transcripts in the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\MessageEntry> + */ + public function getMessageEntries() + { + return $this->message_entries; + } + + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\MessageEntry[] $var + * @return $this + */ + public function setMessageEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\MessageEntry::class); + $this->message_entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php new file mode 100644 index 000000000000..dae90304e8f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php @@ -0,0 +1,412 @@ +google.cloud.dialogflow.v2.ConversationDataset + */ +class ConversationDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $input_config = null; + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $conversation_info = null; + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $conversation_count = 0; + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * @type string $display_name + * Required. The display name of the dataset. Maximum of 64 bytes. + * @type string $description + * Optional. The description of the dataset. Maximum of 10000 bytes. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this dataset. + * @type \Google\Cloud\Dialogflow\V2\InputConfig $input_config + * Output only. Input configurations set during conversation data import. + * @type \Google\Cloud\Dialogflow\V2\ConversationInfo $conversation_info + * Output only. Metadata set during conversation data import. + * @type int|string $conversation_count + * Output only. The number of conversations this conversation dataset + * contains. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationInfo|null + */ + public function getConversationInfo() + { + return $this->conversation_info; + } + + public function hasConversationInfo() + { + return isset($this->conversation_info); + } + + public function clearConversationInfo() + { + unset($this->conversation_info); + } + + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationInfo $var + * @return $this + */ + public function setConversationInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationInfo::class); + $this->conversation_info = $var; + + return $this; + } + + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getConversationCount() + { + return $this->conversation_count; + } + + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setConversationCount($var) + { + GPBUtil::checkInt64($var); + $this->conversation_count = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php new file mode 100644 index 000000000000..05eee225e6f6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php @@ -0,0 +1,233 @@ +google.cloud.dialogflow.v2.ConversationEvent + */ +class ConversationEvent extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + */ + protected $conversation = ''; + /** + * The type of the event that this notification refers to. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2; + */ + protected $type = 0; + /** + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * + * Generated from protobuf field .google.rpc.Status error_status = 3; + */ + protected $error_status = null; + protected $payload; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * @type int $type + * The type of the event that this notification refers to. + * @type \Google\Rpc\Status $error_status + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * @type \Google\Cloud\Dialogflow\V2\Message $new_message_payload + * Payload of NEW_MESSAGE event. + * @type \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $new_recognition_result_payload + * Payload of NEW_RECOGNITION_RESULT event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationEvent::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * The unique identifier of the conversation this notification + * refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * The type of the event that this notification refers to. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the event that this notification refers to. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationEvent\Type::class); + $this->type = $var; + + return $this; + } + + /** + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * + * Generated from protobuf field .google.rpc.Status error_status = 3; + * @return \Google\Rpc\Status|null + */ + public function getErrorStatus() + { + return $this->error_status; + } + + public function hasErrorStatus() + { + return isset($this->error_status); + } + + public function clearErrorStatus() + { + unset($this->error_status); + } + + /** + * More detailed information about an error. Only set for type + * UNRECOVERABLE_ERROR_IN_PHONE_CALL. + * + * Generated from protobuf field .google.rpc.Status error_status = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setErrorStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error_status = $var; + + return $this; + } + + /** + * Payload of NEW_MESSAGE event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message new_message_payload = 4; + * @return \Google\Cloud\Dialogflow\V2\Message|null + */ + public function getNewMessagePayload() + { + return $this->readOneof(4); + } + + public function hasNewMessagePayload() + { + return $this->hasOneof(4); + } + + /** + * Payload of NEW_MESSAGE event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message new_message_payload = 4; + * @param \Google\Cloud\Dialogflow\V2\Message $var + * @return $this + */ + public function setNewMessagePayload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Message::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Payload of NEW_RECOGNITION_RESULT event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult new_recognition_result_payload = 5; + * @return \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null + */ + public function getNewRecognitionResultPayload() + { + return $this->readOneof(5); + } + + public function hasNewRecognitionResultPayload() + { + return $this->hasOneof(5); + } + + /** + * Payload of NEW_RECOGNITION_RESULT event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult new_recognition_result_payload = 5; + * @param \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $var + * @return $this + */ + public function setNewRecognitionResultPayload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getPayload() + { + return $this->whichOneof("payload"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php new file mode 100644 index 000000000000..de7a7bb1d919 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ConversationEvent.Type + */ +class Type +{ + /** + * Type not set. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A new conversation has been opened. This is fired when a telephone call + * is answered, or a conversation is created via the API. + * + * Generated from protobuf enum CONVERSATION_STARTED = 1; + */ + const CONVERSATION_STARTED = 1; + /** + * An existing conversation has closed. This is fired when a telephone call + * is terminated, or a conversation is closed via the API. + * The event is fired for every CompleteConversation call, even if the + * conversation is already closed. + * + * Generated from protobuf enum CONVERSATION_FINISHED = 2; + */ + const CONVERSATION_FINISHED = 2; + /** + * An existing conversation has received notification from Dialogflow that + * human intervention is required. + * + * Generated from protobuf enum HUMAN_INTERVENTION_NEEDED = 3; + */ + const HUMAN_INTERVENTION_NEEDED = 3; + /** + * An existing conversation has received a new message, either from API or + * telephony. It is configured in + * [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config] + * + * Generated from protobuf enum NEW_MESSAGE = 5; + */ + const NEW_MESSAGE = 5; + /** + * An existing conversation has received a new speech recognition result. + * This is mainly for delivering intermediate transcripts. The notification + * is configured in + * [ConversationProfile.new_recognition_event_notification_config][]. + * + * Generated from protobuf enum NEW_RECOGNITION_RESULT = 7; + */ + const NEW_RECOGNITION_RESULT = 7; + /** + * Unrecoverable error during a telephone call. + * In general non-recoverable errors only occur if something was + * misconfigured in the ConversationProfile corresponding to the call. After + * a non-recoverable error, Dialogflow may stop responding. + * We don't fire this event: + * * in an API call because we can directly return the error, or, + * * when we can recover from an error. + * + * Generated from protobuf enum UNRECOVERABLE_ERROR = 4; + */ + const UNRECOVERABLE_ERROR = 4; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::CONVERSATION_STARTED => 'CONVERSATION_STARTED', + self::CONVERSATION_FINISHED => 'CONVERSATION_FINISHED', + self::HUMAN_INTERVENTION_NEEDED => 'HUMAN_INTERVENTION_NEEDED', + self::NEW_MESSAGE => 'NEW_MESSAGE', + self::NEW_RECOGNITION_RESULT => 'NEW_RECOGNITION_RESULT', + self::UNRECOVERABLE_ERROR => 'UNRECOVERABLE_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php new file mode 100644 index 000000000000..f47b94c4b6e8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.ConversationInfo + */ +class ConversationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language code of the conversation data within this dataset. + * See https://cloud.google.com/apis/design/standard_fields for more + * information. Supports all UTF-8 languages. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php new file mode 100644 index 000000000000..fcbdc1e0981e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php @@ -0,0 +1,442 @@ +google.cloud.dialogflow.v2.ConversationModel + */ +class ConversationModel extends \Google\Protobuf\Internal\Message +{ + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $datasets; + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + */ + protected $language_code = ''; + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + protected $model_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * @type string $display_name + * Required. The display name of the model. At most 64 bytes long. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this model. + * @type \Google\Cloud\Dialogflow\V2\InputDataset[] $datasets + * Required. Datasets used to create model. + * @type int $state + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * @type string $language_code + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * @type \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata $article_suggestion_model_metadata + * Metadata for article suggestion models. + * @type \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata $smart_reply_model_metadata + * Metadata for smart reply models. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\InputDataset> + */ + public function getDatasets() + { + return $this->datasets; + } + + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\InputDataset[] $var + * @return $this + */ + public function setDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\InputDataset::class); + $this->datasets = $arr; + + return $this; + } + + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\State::class); + $this->state = $var; + + return $this; + } + + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Metadata for article suggestion models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata article_suggestion_model_metadata = 8; + * @return \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata|null + */ + public function getArticleSuggestionModelMetadata() + { + return $this->readOneof(8); + } + + public function hasArticleSuggestionModelMetadata() + { + return $this->hasOneof(8); + } + + /** + * Metadata for article suggestion models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata article_suggestion_model_metadata = 8; + * @param \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata $var + * @return $this + */ + public function setArticleSuggestionModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ArticleSuggestionModelMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Metadata for smart reply models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyModelMetadata smart_reply_model_metadata = 9; + * @return \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata|null + */ + public function getSmartReplyModelMetadata() + { + return $this->readOneof(9); + } + + public function hasSmartReplyModelMetadata() + { + return $this->hasOneof(9); + } + + /** + * Metadata for smart reply models. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyModelMetadata smart_reply_model_metadata = 9; + * @param \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata $var + * @return $this + */ + public function setSmartReplyModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SmartReplyModelMetadata::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * @return string + */ + public function getModelMetadata() + { + return $this->whichOneof("model_metadata"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php new file mode 100644 index 000000000000..669824707c02 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.ConversationModel.ModelType + */ +class ModelType +{ + /** + * ModelType unspecified. + * + * Generated from protobuf enum MODEL_TYPE_UNSPECIFIED = 0; + */ + const MODEL_TYPE_UNSPECIFIED = 0; + /** + * ModelType smart reply dual encoder model. + * + * Generated from protobuf enum SMART_REPLY_DUAL_ENCODER_MODEL = 2; + */ + const SMART_REPLY_DUAL_ENCODER_MODEL = 2; + /** + * ModelType smart reply bert model. + * + * Generated from protobuf enum SMART_REPLY_BERT_MODEL = 6; + */ + const SMART_REPLY_BERT_MODEL = 6; + + private static $valueToName = [ + self::MODEL_TYPE_UNSPECIFIED => 'MODEL_TYPE_UNSPECIFIED', + self::SMART_REPLY_DUAL_ENCODER_MODEL => 'SMART_REPLY_DUAL_ENCODER_MODEL', + self::SMART_REPLY_BERT_MODEL => 'SMART_REPLY_BERT_MODEL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php new file mode 100644 index 000000000000..319746114cb9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ConversationModel.State + */ +class State +{ + /** + * Should not be used, an un-set enum has this value by default. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Model being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * Model is not deployed but ready to deploy. + * + * Generated from protobuf enum UNDEPLOYED = 2; + */ + const UNDEPLOYED = 2; + /** + * Model is deploying. + * + * Generated from protobuf enum DEPLOYING = 3; + */ + const DEPLOYING = 3; + /** + * Model is deployed and ready to use. + * + * Generated from protobuf enum DEPLOYED = 4; + */ + const DEPLOYED = 4; + /** + * Model is undeploying. + * + * Generated from protobuf enum UNDEPLOYING = 5; + */ + const UNDEPLOYING = 5; + /** + * Model is deleting. + * + * Generated from protobuf enum DELETING = 6; + */ + const DELETING = 6; + /** + * Model is in error state. Not ready to deploy and use. + * + * Generated from protobuf enum FAILED = 7; + */ + const FAILED = 7; + /** + * Model is being created but the training has not started, + * The model may remain in this state until there is enough capacity to + * start training. + * + * Generated from protobuf enum PENDING = 8; + */ + const PENDING = 8; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::UNDEPLOYED => 'UNDEPLOYED', + self::DEPLOYING => 'DEPLOYING', + self::DEPLOYED => 'DEPLOYED', + self::UNDEPLOYING => 'UNDEPLOYING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::PENDING => 'PENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php new file mode 100644 index 000000000000..2ce5b6aec4ad --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php @@ -0,0 +1,329 @@ +google.cloud.dialogflow.v2.ConversationModelEvaluation + */ +class ConversationModelEvaluation extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. The display name of the model evaluation. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig evaluation_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluation_config = null; + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * + * Generated from protobuf field string raw_human_eval_template_csv = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $raw_human_eval_template_csv = ''; + protected $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * @type string $display_name + * Optional. The display name of the model evaluation. At most 64 bytes long. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig $evaluation_config + * Optional. The configuration of the evaluation task. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this model. + * @type \Google\Cloud\Dialogflow\V2\SmartReplyMetrics $smart_reply_metrics + * Output only. Only available when model is for smart reply. + * @type string $raw_human_eval_template_csv + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the evaluation. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The display name of the model evaluation. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The display name of the model evaluation. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig evaluation_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\EvaluationConfig|null + */ + public function getEvaluationConfig() + { + return $this->evaluation_config; + } + + public function hasEvaluationConfig() + { + return isset($this->evaluation_config); + } + + public function clearEvaluationConfig() + { + unset($this->evaluation_config); + } + + /** + * Optional. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig evaluation_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\EvaluationConfig $var + * @return $this + */ + public function setEvaluationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationConfig::class); + $this->evaluation_config = $var; + + return $this; + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Only available when model is for smart reply. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyMetrics smart_reply_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\SmartReplyMetrics|null + */ + public function getSmartReplyMetrics() + { + return $this->readOneof(5); + } + + public function hasSmartReplyMetrics() + { + return $this->hasOneof(5); + } + + /** + * Output only. Only available when model is for smart reply. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SmartReplyMetrics smart_reply_metrics = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SmartReplyMetrics $var + * @return $this + */ + public function setSmartReplyMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SmartReplyMetrics::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * + * Generated from protobuf field string raw_human_eval_template_csv = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRawHumanEvalTemplateCsv() + { + return $this->raw_human_eval_template_csv; + } + + /** + * Output only. Human eval template in csv format. + * It takes real-world conversations provided through input dataset, generates + * example suggestions for customer to verify quality of the model. + * For Smart Reply, the generated csv file contains columns of + * Context, (Suggestions,Q1,Q2)*3, Actual reply. + * Context contains at most 10 latest messages in the conversation prior to + * the current suggestion. + * Q1: "Would you send it as the next message of agent?" + * Evaluated based on whether the suggest is appropriate to be sent by + * agent in current context. + * Q2: "Does the suggestion move the conversation closer to resolution?" + * Evaluated based on whether the suggestion provide solutions, or answers + * customer's question or collect information from customer to resolve the + * customer's issue. + * Actual reply column contains the actual agent reply sent in the context. + * + * Generated from protobuf field string raw_human_eval_template_csv = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRawHumanEvalTemplateCsv($var) + { + GPBUtil::checkString($var, True); + $this->raw_human_eval_template_csv = $var; + + return $this; + } + + /** + * @return string + */ + public function getMetrics() + { + return $this->whichOneof("metrics"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php new file mode 100644 index 000000000000..0f66f67a2813 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.ConversationPhoneNumber + */ +class ConversationPhoneNumber extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Desired country code for the phone number. + * + * Generated from protobuf field int32 country_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $country_code = 0; + /** + * Output only. The phone number to connect to this conversation. + * + * Generated from protobuf field string phone_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_number = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $country_code + * Output only. Desired country code for the phone number. + * @type string $phone_number + * Output only. The phone number to connect to this conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Desired country code for the phone number. + * + * Generated from protobuf field int32 country_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCountryCode() + { + return $this->country_code; + } + + /** + * Output only. Desired country code for the phone number. + * + * Generated from protobuf field int32 country_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCountryCode($var) + { + GPBUtil::checkInt32($var); + $this->country_code = $var; + + return $this; + } + + /** + * Output only. The phone number to connect to this conversation. + * + * Generated from protobuf field string phone_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPhoneNumber() + { + return $this->phone_number; + } + + /** + * Output only. The phone number to connect to this conversation. + * + * Generated from protobuf field string phone_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkString($var, True); + $this->phone_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php new file mode 100644 index 000000000000..eb45524e07e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php @@ -0,0 +1,823 @@ +google.cloud.dialogflow.v2.ConversationProfile + */ +class ConversationProfile extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. Human readable name for this profile. Max length 1024 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. Create time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Configuration for an automated agent to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentConfig automated_agent_config = 3; + */ + protected $automated_agent_config = null; + /** + * Configuration for agent assistance to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig human_agent_assistant_config = 4; + */ + protected $human_agent_assistant_config = null; + /** + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig human_agent_handoff_config = 5; + */ + protected $human_agent_handoff_config = null; + /** + * Configuration for publishing conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 6; + */ + protected $notification_config = null; + /** + * Configuration for logging conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.LoggingConfig logging_config = 7; + */ + protected $logging_config = null; + /** + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_message_event_notification_config = 8; + */ + protected $new_message_event_notification_config = null; + /** + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_recognition_result_notification_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $new_recognition_result_notification_config = null; + /** + * Settings for speech transcription. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechToTextConfig stt_config = 9; + */ + protected $stt_config = null; + /** + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 10; + */ + protected $language_code = ''; + /** + * Optional. Configuration for SIP connections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipConfig sip_config = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sip_config = null; + /** + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * + * Generated from protobuf field string time_zone = 14; + */ + protected $time_zone = ''; + /** + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 13 [(.google.api.resource_reference) = { + */ + protected $security_settings = ''; + /** + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig tts_config = 18; + */ + protected $tts_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @type string $display_name + * Required. Human readable name for this profile. Max length 1024 bytes. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time of the conversation profile. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of the conversation profile. + * @type \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig $automated_agent_config + * Configuration for an automated agent to use with this profile. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig $human_agent_assistant_config + * Configuration for agent assistance to use with this profile. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig $human_agent_handoff_config + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $notification_config + * Configuration for publishing conversation lifecycle events. + * @type \Google\Cloud\Dialogflow\V2\LoggingConfig $logging_config + * Configuration for logging conversation lifecycle events. + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $new_message_event_notification_config + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $new_recognition_result_notification_config + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * @type \Google\Cloud\Dialogflow\V2\SpeechToTextConfig $stt_config + * Settings for speech transcription. + * @type string $language_code + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * @type \Google\Cloud\Dialogflow\V2\SipConfig $sip_config + * Optional. Configuration for SIP connections. + * @type string $time_zone + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * @type string $security_settings + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * @type \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $tts_config + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of this conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Human readable name for this profile. Max length 1024 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Human readable name for this profile. Max length 1024 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Create time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of the conversation profile. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Configuration for an automated agent to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentConfig automated_agent_config = 3; + * @return \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig|null + */ + public function getAutomatedAgentConfig() + { + return $this->automated_agent_config; + } + + public function hasAutomatedAgentConfig() + { + return isset($this->automated_agent_config); + } + + public function clearAutomatedAgentConfig() + { + unset($this->automated_agent_config); + } + + /** + * Configuration for an automated agent to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentConfig automated_agent_config = 3; + * @param \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig $var + * @return $this + */ + public function setAutomatedAgentConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentConfig::class); + $this->automated_agent_config = $var; + + return $this; + } + + /** + * Configuration for agent assistance to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig human_agent_assistant_config = 4; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig|null + */ + public function getHumanAgentAssistantConfig() + { + return $this->human_agent_assistant_config; + } + + public function hasHumanAgentAssistantConfig() + { + return isset($this->human_agent_assistant_config); + } + + public function clearHumanAgentAssistantConfig() + { + unset($this->human_agent_assistant_config); + } + + /** + * Configuration for agent assistance to use with this profile. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig human_agent_assistant_config = 4; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig $var + * @return $this + */ + public function setHumanAgentAssistantConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig::class); + $this->human_agent_assistant_config = $var; + + return $this; + } + + /** + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig human_agent_handoff_config = 5; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig|null + */ + public function getHumanAgentHandoffConfig() + { + return $this->human_agent_handoff_config; + } + + public function hasHumanAgentHandoffConfig() + { + return isset($this->human_agent_handoff_config); + } + + public function clearHumanAgentHandoffConfig() + { + unset($this->human_agent_handoff_config); + } + + /** + * Configuration for connecting to a live agent. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig human_agent_handoff_config = 5; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig $var + * @return $this + */ + public function setHumanAgentHandoffConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig::class); + $this->human_agent_handoff_config = $var; + + return $this; + } + + /** + * Configuration for publishing conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 6; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNotificationConfig() + { + return $this->notification_config; + } + + public function hasNotificationConfig() + { + return isset($this->notification_config); + } + + public function clearNotificationConfig() + { + unset($this->notification_config); + } + + /** + * Configuration for publishing conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 6; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->notification_config = $var; + + return $this; + } + + /** + * Configuration for logging conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.LoggingConfig logging_config = 7; + * @return \Google\Cloud\Dialogflow\V2\LoggingConfig|null + */ + public function getLoggingConfig() + { + return $this->logging_config; + } + + public function hasLoggingConfig() + { + return isset($this->logging_config); + } + + public function clearLoggingConfig() + { + unset($this->logging_config); + } + + /** + * Configuration for logging conversation lifecycle events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.LoggingConfig logging_config = 7; + * @param \Google\Cloud\Dialogflow\V2\LoggingConfig $var + * @return $this + */ + public function setLoggingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\LoggingConfig::class); + $this->logging_config = $var; + + return $this; + } + + /** + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_message_event_notification_config = 8; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNewMessageEventNotificationConfig() + { + return $this->new_message_event_notification_config; + } + + public function hasNewMessageEventNotificationConfig() + { + return isset($this->new_message_event_notification_config); + } + + public function clearNewMessageEventNotificationConfig() + { + unset($this->new_message_event_notification_config); + } + + /** + * Configuration for publishing new message events. Event will be sent in + * format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_message_event_notification_config = 8; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNewMessageEventNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->new_message_event_notification_config = $var; + + return $this; + } + + /** + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_recognition_result_notification_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNewRecognitionResultNotificationConfig() + { + return $this->new_recognition_result_notification_config; + } + + public function hasNewRecognitionResultNotificationConfig() + { + return isset($this->new_recognition_result_notification_config); + } + + public function clearNewRecognitionResultNotificationConfig() + { + unset($this->new_recognition_result_notification_config); + } + + /** + * Optional. Configuration for publishing transcription intermediate results. + * Event will be sent in format of + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + * configured, the following information will be populated as + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + * message attributes: + * - "participant_id" + * - "participant_role" + * - "message_id" + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig new_recognition_result_notification_config = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNewRecognitionResultNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->new_recognition_result_notification_config = $var; + + return $this; + } + + /** + * Settings for speech transcription. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechToTextConfig stt_config = 9; + * @return \Google\Cloud\Dialogflow\V2\SpeechToTextConfig|null + */ + public function getSttConfig() + { + return $this->stt_config; + } + + public function hasSttConfig() + { + return isset($this->stt_config); + } + + public function clearSttConfig() + { + unset($this->stt_config); + } + + /** + * Settings for speech transcription. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechToTextConfig stt_config = 9; + * @param \Google\Cloud\Dialogflow\V2\SpeechToTextConfig $var + * @return $this + */ + public function setSttConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SpeechToTextConfig::class); + $this->stt_config = $var; + + return $this; + } + + /** + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 10; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for the conversation profile. If not specified, the language + * is en-US. Language at ConversationProfile should be set for all non en-US + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 10; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Configuration for SIP connections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipConfig sip_config = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SipConfig|null + */ + public function getSipConfig() + { + return $this->sip_config; + } + + public function hasSipConfig() + { + return isset($this->sip_config); + } + + public function clearSipConfig() + { + unset($this->sip_config); + } + + /** + * Optional. Configuration for SIP connections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipConfig sip_config = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SipConfig $var + * @return $this + */ + public function setSipConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SipConfig::class); + $this->sip_config = $var; + + return $this; + } + + /** + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * + * Generated from protobuf field string time_zone = 14; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * The time zone of this conversational profile from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. Defaults to America/New_York. + * + * Generated from protobuf field string time_zone = 14; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 13 [(.google.api.resource_reference) = { + * @return string + */ + public function getSecuritySettings() + { + return $this->security_settings; + } + + /** + * Name of the CX SecuritySettings reference for the agent. + * Format: `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 13 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecuritySettings($var) + { + GPBUtil::checkString($var, True); + $this->security_settings = $var; + + return $this; + } + + /** + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig tts_config = 18; + * @return \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig|null + */ + public function getTtsConfig() + { + return $this->tts_config; + } + + public function hasTtsConfig() + { + return isset($this->tts_config); + } + + public function clearTtsConfig() + { + unset($this->tts_config); + } + + /** + * Configuration for Text-to-Speech synthesization. + * Used by Phone Gateway to specify synthesization options. If agent defines + * synthesization options as well, agent settings overrides the option here. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig tts_config = 18; + * @param \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $var + * @return $this + */ + public function setTtsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig::class); + $this->tts_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php new file mode 100644 index 000000000000..237d4f4984e2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.CreateContextRequest + */ +class CreateContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The context to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $context = null; + + /** + * @param string $parent Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Context $context Required. The context to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateContextRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Context $context): self + { + return (new self()) + ->setParent($parent) + ->setContext($context); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type \Google\Cloud\Dialogflow\V2\Context $context + * Required. The context to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The context to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Context|null + */ + public function getContext() + { + return $this->context; + } + + public function hasContext() + { + return isset($this->context); + } + + public function clearContext() + { + unset($this->context); + } + + /** + * Required. The context to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Context $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Context::class); + $this->context = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php new file mode 100644 index 000000000000..42ac76b38176 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata + */ +class CreateConversationDatasetOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + */ + protected $conversation_dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_dataset + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + /** + * The resource name of the conversation dataset that will be created. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkString($var, True); + $this->conversation_dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php new file mode 100644 index 000000000000..2192bf380a70 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.CreateConversationDatasetRequest + */ +class CreateConversationDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The conversation dataset to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationDataset conversation_dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_dataset = null; + + /** + * @param string $parent Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * @param \Google\Cloud\Dialogflow\V2\ConversationDataset $conversationDataset Required. The conversation dataset to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationDatasetRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationDataset $conversationDataset): self + { + return (new self()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * @type \Google\Cloud\Dialogflow\V2\ConversationDataset $conversation_dataset + * Required. The conversation dataset to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation dataset to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationDataset conversation_dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationDataset|null + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + public function hasConversationDataset() + { + return isset($this->conversation_dataset); + } + + public function clearConversationDataset() + { + unset($this->conversation_dataset); + } + + /** + * Required. The conversation dataset to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationDataset conversation_dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationDataset $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationDataset::class); + $this->conversation_dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php new file mode 100644 index 000000000000..6e6314df72ea --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php @@ -0,0 +1,201 @@ +google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata + */ +class CreateConversationModelEvaluationOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * + * Generated from protobuf field string conversation_model_evaluation = 1; + */ + protected $conversation_model_evaluation = ''; + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string conversation_model = 4; + */ + protected $conversation_model = ''; + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State state = 2; + */ + protected $state = 0; + /** + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model_evaluation + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * @type int $state + * State of CreateConversationModel operation. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * + * Generated from protobuf field string conversation_model_evaluation = 1; + * @return string + */ + public function getConversationModelEvaluation() + { + return $this->conversation_model_evaluation; + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels//evaluations/` + * + * Generated from protobuf field string conversation_model_evaluation = 1; + * @param string $var + * @return $this + */ + public function setConversationModelEvaluation($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model_evaluation = $var; + + return $this; + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string conversation_model = 4; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string conversation_model = 4; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when the request to create conversation model was submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php new file mode 100644 index 000000000000..9d577f4306ba --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State + */ +class State +{ + /** + * Operation status not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The operation is being prepared. + * + * Generated from protobuf enum INITIALIZING = 1; + */ + const INITIALIZING = 1; + /** + * The operation is running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The operation is cancelled. + * + * Generated from protobuf enum CANCELLED = 3; + */ + const CANCELLED = 3; + /** + * The operation has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 4; + */ + const SUCCEEDED = 4; + /** + * The operation has failed. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::INITIALIZING => 'INITIALIZING', + self::RUNNING => 'RUNNING', + self::CANCELLED => 'CANCELLED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php new file mode 100644 index 000000000000..d4ea7ee33185 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest + */ +class CreateConversationModelEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The conversation model evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_model_evaluation = null; + + /** + * @param string $parent Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * Please see {@see ConversationModelsClient::conversationModelName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $conversationModelEvaluation Required. The conversation model evaluation to be created. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $conversationModelEvaluation): self + { + return (new self()) + ->setParent($parent) + ->setConversationModelEvaluation($conversationModelEvaluation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * @type \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $conversation_model_evaluation + * Required. The conversation model evaluation to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation model evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation|null + */ + public function getConversationModelEvaluation() + { + return $this->conversation_model_evaluation; + } + + public function hasConversationModelEvaluation() + { + return isset($this->conversation_model_evaluation); + } + + public function clearConversationModelEvaluation() + { + unset($this->conversation_model_evaluation); + } + + /** + * Required. The conversation model evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation $var + * @return $this + */ + public function setConversationModelEvaluation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation::class); + $this->conversation_model_evaluation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php new file mode 100644 index 000000000000..8d2f640586f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php @@ -0,0 +1,199 @@ +google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata + */ +class CreateConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State state = 2; + */ + protected $state = 0; + /** + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 7; + */ + protected $done_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type int $state + * State of CreateConversationModel operation. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * @type \Google\Protobuf\Timestamp $done_time + * The time when the operation finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of CreateConversationModel operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when the request to create conversation model is submitted. The + * time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDoneTime() + { + return $this->done_time; + } + + public function hasDoneTime() + { + return isset($this->done_time); + } + + public function clearDoneTime() + { + unset($this->done_time); + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDoneTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->done_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php new file mode 100644 index 000000000000..0d978cfed1c7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php @@ -0,0 +1,91 @@ +google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State + */ +class State +{ + /** + * Invalid. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Request is submitted, but training has not started yet. + * The model may remain in this state until there is enough capacity to + * start training. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The training has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * The training has succeeded. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The training has been cancelled. + * + * Generated from protobuf enum CANCELLED = 4; + */ + const CANCELLED = 4; + /** + * The training is in cancelling state. + * + * Generated from protobuf enum CANCELLING = 5; + */ + const CANCELLING = 5; + /** + * Custom model is training. + * + * Generated from protobuf enum TRAINING = 6; + */ + const TRAINING = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + self::CANCELLING => 'CANCELLING', + self::TRAINING => 'TRAINING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php new file mode 100644 index 000000000000..74c320d7645c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.CreateConversationModelRequest + */ +class CreateConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The project to create conversation model for. Format: + * `projects/` + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * Required. The conversation model to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel conversation_model = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_model = null; + + /** + * @param string $parent The project to create conversation model for. Format: + * `projects/` + * @param \Google\Cloud\Dialogflow\V2\ConversationModel $conversationModel Required. The conversation model to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationModelRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationModel $conversationModel): self + { + return (new self()) + ->setParent($parent) + ->setConversationModel($conversationModel); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The project to create conversation model for. Format: + * `projects/` + * @type \Google\Cloud\Dialogflow\V2\ConversationModel $conversation_model + * Required. The conversation model to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The project to create conversation model for. Format: + * `projects/` + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The project to create conversation model for. Format: + * `projects/` + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation model to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel conversation_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationModel|null + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + public function hasConversationModel() + { + return isset($this->conversation_model); + } + + public function clearConversationModel() + { + unset($this->conversation_model); + } + + /** + * Required. The conversation model to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel conversation_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationModel $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationModel::class); + $this->conversation_model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php new file mode 100644 index 000000000000..dc570d4763ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.CreateConversationProfileRequest + */ +class CreateConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The conversation profile to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + + /** + * @param string $parent Required. The project to create a conversation profile for. + * Format: `projects//locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile Required. The conversation profile to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationProfileRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile): self + { + return (new self()) + ->setParent($parent) + ->setConversationProfile($conversationProfile); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. The conversation profile to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation profile to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. The conversation profile to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php new file mode 100644 index 000000000000..68dcc8815f45 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php @@ -0,0 +1,199 @@ +google.cloud.dialogflow.v2.CreateConversationRequest + */ +class CreateConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation = null; + /** + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string conversation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_id = ''; + + /** + * @param string $parent Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Conversation $conversation Required. The conversation to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateConversationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Conversation $conversation): self + { + return (new self()) + ->setParent($parent) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\Conversation $conversation + * Required. The conversation to create. + * @type string $conversation_id + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Conversation|null + */ + public function getConversation() + { + return $this->conversation; + } + + public function hasConversation() + { + return isset($this->conversation); + } + + public function clearConversation() + { + unset($this->conversation); + } + + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Conversation $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Conversation::class); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string conversation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * Optional. Identifier of the conversation. Generally it's auto generated by + * Google. Only set it if you cannot wait for the response to return a + * auto-generated one to you. + * The conversation ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string conversation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php new file mode 100644 index 000000000000..94c328d7240f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.CreateDocumentRequest + */ +class CreateDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The document to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document = null; + + /** + * @param string $parent Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Document $document Required. The document to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateDocumentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Document $document): self + { + return (new self()) + ->setParent($parent) + ->setDocument($document); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * @type \Google\Cloud\Dialogflow\V2\Document $document + * Required. The document to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The document to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Required. The document to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Document::class); + $this->document = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php new file mode 100644 index 000000000000..7d91dd4816b6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php @@ -0,0 +1,206 @@ +google.cloud.dialogflow.v2.CreateEntityTypeRequest + */ +class CreateEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_type = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $parent Required. The agent to create a entity type for. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateEntityTypeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\EntityType $entityType): self + { + return (new self()) + ->setParent($parent) + ->setEntityType($entityType); + } + + /** + * @param string $parent Required. The agent to create a entity type for. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\CreateEntityTypeRequest + * + * @experimental + */ + public static function buildFromParentEntityTypeLanguageCode(string $parent, \Google\Cloud\Dialogflow\V2\EntityType $entityType, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setEntityType($entityType) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * @type \Google\Cloud\Dialogflow\V2\EntityType $entity_type + * Required. The entity type to create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EntityType|null + */ + public function getEntityType() + { + return $this->entity_type; + } + + public function hasEntityType() + { + return isset($this->entity_type); + } + + public function clearEntityType() + { + unset($this->entity_type); + } + + /** + * Required. The entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_type = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php new file mode 100644 index 000000000000..da37e7ce706d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.CreateEnvironmentRequest + */ +class CreateEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The environment to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment = null; + /** + * Required. The unique id of the new environment. + * + * Generated from protobuf field string environment_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @type \Google\Cloud\Dialogflow\V2\Environment $environment + * Required. The environment to create. + * @type string $environment_id + * Required. The unique id of the new environment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The environment to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Required. The environment to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Environment::class); + $this->environment = $var; + + return $this; + } + + /** + * Required. The unique id of the new environment. + * + * Generated from protobuf field string environment_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEnvironmentId() + { + return $this->environment_id; + } + + /** + * Required. The unique id of the new environment. + * + * Generated from protobuf field string environment_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEnvironmentId($var) + { + GPBUtil::checkString($var, True); + $this->environment_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorEvaluationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorEvaluationRequest.php new file mode 100644 index 000000000000..94ccd6a5c6f7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorEvaluationRequest.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.CreateGeneratorEvaluationRequest + */ +class CreateGeneratorEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The generator evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluation generator_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator_evaluation = null; + + /** + * @param string $parent Required. The generator resource name. Format: + * `projects//locations//generators/` + * Please see {@see GeneratorEvaluationsClient::generatorName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluation $generatorEvaluation Required. The generator evaluation to be created. + * + * @return \Google\Cloud\Dialogflow\V2\CreateGeneratorEvaluationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\GeneratorEvaluation $generatorEvaluation): self + { + return (new self()) + ->setParent($parent) + ->setGeneratorEvaluation($generatorEvaluation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluation $generator_evaluation + * Required. The generator evaluation to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The generator evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluation generator_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorEvaluation|null + */ + public function getGeneratorEvaluation() + { + return $this->generator_evaluation; + } + + public function hasGeneratorEvaluation() + { + return isset($this->generator_evaluation); + } + + public function clearGeneratorEvaluation() + { + unset($this->generator_evaluation); + } + + /** + * Required. The generator evaluation to be created. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluation generator_evaluation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluation $var + * @return $this + */ + public function setGeneratorEvaluation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluation::class); + $this->generator_evaluation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php new file mode 100644 index 000000000000..78f1221e70e0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.CreateGeneratorRequest + */ +class CreateGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator = null; + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generator_id = ''; + + /** + * @param string $parent Required. The project/location to create generator for. Format: + * `projects//locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to create. + * @param string $generatorId Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * @return \Google\Cloud\Dialogflow\V2\CreateGeneratorRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Generator $generator, string $generatorId): self + { + return (new self()) + ->setParent($parent) + ->setGenerator($generator) + ->setGeneratorId($generatorId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Required. The generator to create. + * @type string $generator_id + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->generator; + } + + public function hasGenerator() + { + return isset($this->generator); + } + + public function clearGenerator() + { + unset($this->generator); + } + + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generator = $var; + + return $this; + } + + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGeneratorId() + { + return $this->generator_id; + } + + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGeneratorId($var) + { + GPBUtil::checkString($var, True); + $this->generator_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php new file mode 100644 index 000000000000..7e2680909d1d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php @@ -0,0 +1,240 @@ +google.cloud.dialogflow.v2.CreateIntentRequest + */ +class CreateIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The intent to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $intent = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + + /** + * @param string $parent Required. The agent to create a intent for. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateIntentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Intent $intent): self + { + return (new self()) + ->setParent($parent) + ->setIntent($intent); + } + + /** + * @param string $parent Required. The agent to create a intent for. + * Format: `projects//agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to create. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\CreateIntentRequest + * + * @experimental + */ + public static function buildFromParentIntentLanguageCode(string $parent, \Google\Cloud\Dialogflow\V2\Intent $intent, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setIntent($intent) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * @type \Google\Cloud\Dialogflow\V2\Intent $intent + * Required. The intent to create. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create a intent for. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The intent to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent|null + */ + public function getIntent() + { + return $this->intent; + } + + public function hasIntent() + { + return isset($this->intent); + } + + public function clearIntent() + { + unset($this->intent); + } + + /** + * Required. The intent to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent $var + * @return $this + */ + public function setIntent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php new file mode 100644 index 000000000000..9d66d5a7d744 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + */ +class CreateKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The knowledge base to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $knowledge_base = null; + + /** + * @param string $parent Required. The project to create a knowledge base for. + * Format: `projects//locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase Required. The knowledge base to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateKnowledgeBaseRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase): self + { + return (new self()) + ->setParent($parent) + ->setKnowledgeBase($knowledgeBase); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledge_base + * Required. The knowledge base to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The knowledge base to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeBase|null + */ + public function getKnowledgeBase() + { + return $this->knowledge_base; + } + + public function hasKnowledgeBase() + { + return isset($this->knowledge_base); + } + + public function clearKnowledgeBase() + { + unset($this->knowledge_base); + } + + /** + * Required. The knowledge base to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $var + * @return $this + */ + public function setKnowledgeBase($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeBase::class); + $this->knowledge_base = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php new file mode 100644 index 000000000000..1546783d24f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.CreateParticipantRequest + */ +class CreateParticipantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The participant to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant = null; + + /** + * @param string $parent Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Participant $participant Required. The participant to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateParticipantRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Participant $participant): self + { + return (new self()) + ->setParent($parent) + ->setParticipant($participant); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @type \Google\Cloud\Dialogflow\V2\Participant $participant + * Required. The participant to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The participant to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Participant|null + */ + public function getParticipant() + { + return $this->participant; + } + + public function hasParticipant() + { + return isset($this->participant); + } + + public function clearParticipant() + { + unset($this->participant); + } + + /** + * Required. The participant to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Participant $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Participant::class); + $this->participant = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php new file mode 100644 index 000000000000..fbae1b795a55 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest + */ +class CreateSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The session entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_entity_type = null; + + /** + * @param string $parent Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType Required. The session entity type to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateSessionEntityTypeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType): self + { + return (new self()) + ->setParent($parent) + ->setSessionEntityType($sessionEntityType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType $session_entity_type + * Required. The session entity type to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The session entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\SessionEntityType|null + */ + public function getSessionEntityType() + { + return $this->session_entity_type; + } + + public function hasSessionEntityType() + { + return isset($this->session_entity_type); + } + + public function clearSessionEntityType() + { + unset($this->session_entity_type); + } + + /** + * Required. The session entity type to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $var + * @return $this + */ + public function setSessionEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSipTrunkRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSipTrunkRequest.php new file mode 100644 index 000000000000..b089c76e32b9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSipTrunkRequest.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.CreateSipTrunkRequest + */ +class CreateSipTrunkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location to create a SIP trunk for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The SIP trunk to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipTrunk sip_trunk = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sip_trunk = null; + + /** + * @param string $parent Required. The location to create a SIP trunk for. + * Format: `projects//locations/`. Please see + * {@see SipTrunksClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\SipTrunk $sipTrunk Required. The SIP trunk to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateSipTrunkRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\SipTrunk $sipTrunk): self + { + return (new self()) + ->setParent($parent) + ->setSipTrunk($sipTrunk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location to create a SIP trunk for. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\SipTrunk $sip_trunk + * Required. The SIP trunk to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location to create a SIP trunk for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location to create a SIP trunk for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The SIP trunk to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipTrunk sip_trunk = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\SipTrunk|null + */ + public function getSipTrunk() + { + return $this->sip_trunk; + } + + public function hasSipTrunk() + { + return isset($this->sip_trunk); + } + + public function clearSipTrunk() + { + unset($this->sip_trunk); + } + + /** + * Required. The SIP trunk to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipTrunk sip_trunk = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SipTrunk $var + * @return $this + */ + public function setSipTrunk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SipTrunk::class); + $this->sip_trunk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateToolRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateToolRequest.php new file mode 100644 index 000000000000..200e4b96851e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateToolRequest.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.CreateToolRequest + */ +class CreateToolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to create tool for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The tool to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool tool = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tool = null; + /** + * Optional. The ID to use for the tool, which will become the final + * component of the tool's resource name. + * The tool ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provide, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string tool_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tool_id = ''; + + /** + * @param string $parent Required. The project/location to create tool for. Format: + * `projects//locations/` + * Please see {@see ToolsClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Tool $tool Required. The tool to create. + * @param string $toolId Optional. The ID to use for the tool, which will become the final + * component of the tool's resource name. + * + * The tool ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provide, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * @return \Google\Cloud\Dialogflow\V2\CreateToolRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Tool $tool, string $toolId): self + { + return (new self()) + ->setParent($parent) + ->setTool($tool) + ->setToolId($toolId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to create tool for. Format: + * `projects//locations/` + * @type \Google\Cloud\Dialogflow\V2\Tool $tool + * Required. The tool to create. + * @type string $tool_id + * Optional. The ID to use for the tool, which will become the final + * component of the tool's resource name. + * The tool ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provide, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to create tool for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to create tool for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The tool to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool tool = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Tool|null + */ + public function getTool() + { + return $this->tool; + } + + public function hasTool() + { + return isset($this->tool); + } + + public function clearTool() + { + unset($this->tool); + } + + /** + * Required. The tool to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool tool = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Tool $var + * @return $this + */ + public function setTool($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool::class); + $this->tool = $var; + + return $this; + } + + /** + * Optional. The ID to use for the tool, which will become the final + * component of the tool's resource name. + * The tool ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provide, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string tool_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getToolId() + { + return $this->tool_id; + } + + /** + * Optional. The ID to use for the tool, which will become the final + * component of the tool's resource name. + * The tool ID must be compliant with the regression formula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provide, an Id will be auto-generated. + * If the field is provided, the caller is responsible for + * 1. the uniqueness of the ID, otherwise the request will be rejected. + * 2. the consistency for whether to use custom ID or not under a project to + * better ensure uniqueness. + * + * Generated from protobuf field string tool_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setToolId($var) + { + GPBUtil::checkString($var, True); + $this->tool_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php new file mode 100644 index 000000000000..a3f456d44c02 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php @@ -0,0 +1,144 @@ +google.cloud.dialogflow.v2.CreateVersionRequest + */ +class CreateVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The version to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $version = null; + + /** + * @param string $parent Required. The agent to create a version for. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Version $version Required. The version to create. + * + * @return \Google\Cloud\Dialogflow\V2\CreateVersionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Version $version): self + { + return (new self()) + ->setParent($parent) + ->setVersion($version); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @type \Google\Cloud\Dialogflow\V2\Version $version + * Required. The version to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The version to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Version|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Required. The version to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Version $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Version::class); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams.php new file mode 100644 index 000000000000..072e86ca884a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.CustomPronunciationParams + */ +class CustomPronunciationParams extends \Google\Protobuf\Internal\Message +{ + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field string phrase = 1; + */ + protected $phrase = ''; + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + */ + protected $phonetic_encoding = 0; + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field string pronunciation = 3; + */ + protected $pronunciation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $phrase + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * @type int $phonetic_encoding + * The phonetic encoding of the phrase. + * @type string $pronunciation + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field string phrase = 1; + * @return string + */ + public function getPhrase() + { + return $this->phrase; + } + + /** + * The phrase to which the customization is applied. + * The phrase can be multiple words, such as proper nouns, but shouldn't span + * the length of the sentence. + * + * Generated from protobuf field string phrase = 1; + * @param string $var + * @return $this + */ + public function setPhrase($var) + { + GPBUtil::checkString($var, True); + $this->phrase = $var; + + return $this; + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @return int + */ + public function getPhoneticEncoding() + { + return $this->phonetic_encoding; + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @param int $var + * @return $this + */ + public function setPhoneticEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\CustomPronunciationParams\PhoneticEncoding::class); + $this->phonetic_encoding = $var; + + return $this; + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field string pronunciation = 3; + * @return string + */ + public function getPronunciation() + { + return $this->pronunciation; + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field string pronunciation = 3; + * @param string $var + * @return $this + */ + public function setPronunciation($var) + { + GPBUtil::checkString($var, True); + $this->pronunciation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams/PhoneticEncoding.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams/PhoneticEncoding.php new file mode 100644 index 000000000000..7e2d9eb66b71 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CustomPronunciationParams/PhoneticEncoding.php @@ -0,0 +1,63 @@ +google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding + */ +class PhoneticEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; + */ + const PHONETIC_ENCODING_UNSPECIFIED = 0; + /** + * IPA, such as apple -> ˈæpəl. + * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + * + * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; + */ + const PHONETIC_ENCODING_IPA = 1; + /** + * X-SAMPA, such as apple -> "{p\@l". + * https://en.wikipedia.org/wiki/X-SAMPA + * + * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; + */ + const PHONETIC_ENCODING_X_SAMPA = 2; + + private static $valueToName = [ + self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', + self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', + self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DatastoreResponseReason.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DatastoreResponseReason.php new file mode 100644 index 000000000000..bb3269d7d078 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DatastoreResponseReason.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.DatastoreResponseReason + */ +class DatastoreResponseReason +{ + /** + * Default value. + * + * Generated from protobuf enum DATASTORE_RESPONSE_REASON_UNSPECIFIED = 0; + */ + const DATASTORE_RESPONSE_REASON_UNSPECIFIED = 0; + /** + * No specific response reason from datastore. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Search is blocked due to out of quota. + * + * Generated from protobuf enum SEARCH_OUT_OF_QUOTA = 2; + */ + const SEARCH_OUT_OF_QUOTA = 2; + /** + * Search returns empty results. + * + * Generated from protobuf enum SEARCH_EMPTY_RESULTS = 3; + */ + const SEARCH_EMPTY_RESULTS = 3; + /** + * Generative AI is disabled. + * + * Generated from protobuf enum ANSWER_GENERATION_GEN_AI_DISABLED = 4; + */ + const ANSWER_GENERATION_GEN_AI_DISABLED = 4; + /** + * Answer generation is blocked due to out of quota. + * + * Generated from protobuf enum ANSWER_GENERATION_OUT_OF_QUOTA = 5; + */ + const ANSWER_GENERATION_OUT_OF_QUOTA = 5; + /** + * Answer generation encounters an error. + * + * Generated from protobuf enum ANSWER_GENERATION_ERROR = 6; + */ + const ANSWER_GENERATION_ERROR = 6; + /** + * Answer generation does not have enough information to generate answer. + * + * Generated from protobuf enum ANSWER_GENERATION_NOT_ENOUGH_INFO = 7; + */ + const ANSWER_GENERATION_NOT_ENOUGH_INFO = 7; + /** + * Answer generation is blocked by RAI (Responsible AI) failure. + * + * Generated from protobuf enum ANSWER_GENERATION_RAI_FAILED = 8; + */ + const ANSWER_GENERATION_RAI_FAILED = 8; + /** + * Answer generation is not grounded on reliable sources. + * + * Generated from protobuf enum ANSWER_GENERATION_NOT_GROUNDED = 9; + */ + const ANSWER_GENERATION_NOT_GROUNDED = 9; + + private static $valueToName = [ + self::DATASTORE_RESPONSE_REASON_UNSPECIFIED => 'DATASTORE_RESPONSE_REASON_UNSPECIFIED', + self::NONE => 'NONE', + self::SEARCH_OUT_OF_QUOTA => 'SEARCH_OUT_OF_QUOTA', + self::SEARCH_EMPTY_RESULTS => 'SEARCH_EMPTY_RESULTS', + self::ANSWER_GENERATION_GEN_AI_DISABLED => 'ANSWER_GENERATION_GEN_AI_DISABLED', + self::ANSWER_GENERATION_OUT_OF_QUOTA => 'ANSWER_GENERATION_OUT_OF_QUOTA', + self::ANSWER_GENERATION_ERROR => 'ANSWER_GENERATION_ERROR', + self::ANSWER_GENERATION_NOT_ENOUGH_INFO => 'ANSWER_GENERATION_NOT_ENOUGH_INFO', + self::ANSWER_GENERATION_RAI_FAILED => 'ANSWER_GENERATION_RAI_FAILED', + self::ANSWER_GENERATION_NOT_GROUNDED => 'ANSWER_GENERATION_NOT_GROUNDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php new file mode 100644 index 000000000000..43b4a95340d2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.DeleteAgentRequest + */ +class DeleteAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The project that the agent to delete is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAllContextsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAllContextsRequest.php new file mode 100644 index 000000000000..5d62f022a8c2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAllContextsRequest.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.DeleteAllContextsRequest + */ +class DeleteAllContextsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteAllContextsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteContextRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteContextRequest.php new file mode 100644 index 000000000000..3eeb4dec3c7f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteContextRequest.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.DeleteContextRequest + */ +class DeleteContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteContextRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetOperationMetadata.php new file mode 100644 index 000000000000..9c6a0bb6929f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata + */ +class DeleteConversationDatasetOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetRequest.php new file mode 100644 index 000000000000..56ad714781d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteConversationDatasetRequest + */ +class DeleteConversationDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteConversationDatasetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php new file mode 100644 index 000000000000..7d53e290db00 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata + */ +class DeleteConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + */ + protected $done_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * @type \Google\Protobuf\Timestamp $done_time + * The time when the operation finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when delete conversation model request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDoneTime() + { + return $this->done_time; + } + + public function hasDoneTime() + { + return isset($this->done_time); + } + + public function clearDoneTime() + { + unset($this->done_time); + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDoneTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->done_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelRequest.php new file mode 100644 index 000000000000..1a60578fdd61 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.DeleteConversationModelRequest + */ +class DeleteConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * @return \Google\Cloud\Dialogflow\V2\DeleteConversationModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationProfileRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationProfileRequest.php new file mode 100644 index 000000000000..d29b5d27bff7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationProfileRequest.php @@ -0,0 +1,94 @@ +google.cloud.dialogflow.v2.DeleteConversationProfileRequest + */ +class DeleteConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteConversationProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteDocumentRequest.php new file mode 100644 index 000000000000..286ec0c18a63 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteDocumentRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteDocumentRequest + */ +class DeleteDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteDocumentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEntityTypeRequest.php new file mode 100644 index 000000000000..61674de149d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEntityTypeRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.DeleteEntityTypeRequest + */ +class DeleteEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEnvironmentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEnvironmentRequest.php new file mode 100644 index 000000000000..4cb8c2fcb0ac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEnvironmentRequest.php @@ -0,0 +1,88 @@ +google.cloud.dialogflow.v2.DeleteEnvironmentRequest + */ +class DeleteEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorEvaluationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorEvaluationRequest.php new file mode 100644 index 000000000000..a6f22832bb9f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorEvaluationRequest.php @@ -0,0 +1,91 @@ +google.cloud.dialogflow.v2.DeleteGeneratorEvaluationRequest + */ +class DeleteGeneratorEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators// + * evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator evaluation resource name. Format: + * `projects//locations//generators// + * evaluations/` + * Please see {@see GeneratorEvaluationsClient::generatorEvaluationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteGeneratorEvaluationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators// + * evaluations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators// + * evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators// + * evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php new file mode 100644 index 000000000000..5b540967718c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.DeleteGeneratorRequest + */ +class DeleteGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteGeneratorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php new file mode 100644 index 000000000000..75a7b37a8c8d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteIntentRequest + */ +class DeleteIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteIntentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php new file mode 100644 index 000000000000..d56c789f2468 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + */ +class DeleteKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteKnowledgeBaseRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * @type bool $force + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * + * Generated from protobuf field bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php new file mode 100644 index 000000000000..ebe0300fce4f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest + */ +class DeleteSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteSessionEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSipTrunkRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSipTrunkRequest.php new file mode 100644 index 000000000000..5a4dab7f0aa7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSipTrunkRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.DeleteSipTrunkRequest + */ +class DeleteSipTrunkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. Please see + * {@see SipTrunksClient::sipTrunkName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteSipTrunkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteToolRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteToolRequest.php new file mode 100644 index 000000000000..c06acd311d3b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteToolRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.DeleteToolRequest + */ +class DeleteToolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The tool resource name to delete. Format: + * `projects//locations//tools/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The tool resource name to delete. Format: + * `projects//locations//tools/` + * Please see {@see ToolsClient::toolName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteToolRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The tool resource name to delete. Format: + * `projects//locations//tools/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The tool resource name to delete. Format: + * `projects//locations//tools/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The tool resource name to delete. Format: + * `projects//locations//tools/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php new file mode 100644 index 000000000000..c75b3c359a6b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.DeleteVersionRequest + */ +class DeleteVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the version to delete. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php new file mode 100644 index 000000000000..697a864b6894 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata + */ +class DeployConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + */ + protected $done_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * @type \Google\Protobuf\Timestamp $done_time + * The time when the operation finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when request to deploy conversation model was submitted. The time + * is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDoneTime() + { + return $this->done_time; + } + + public function hasDoneTime() + { + return isset($this->done_time); + } + + public function clearDoneTime() + { + unset($this->done_time); + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDoneTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->done_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php new file mode 100644 index 000000000000..94ea22cf8753 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.DeployConversationModelRequest + */ +class DeployConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php new file mode 100644 index 000000000000..6a29bf64e7ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php @@ -0,0 +1,428 @@ +google.cloud.dialogflow.v2.DetectIntentRequest + */ +class DetectIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $session = ''; + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + */ + protected $query_params = null; + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query_input = null; + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 4; + */ + protected $output_audio_config = null; + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + */ + protected $output_audio_config_mask = null; + /** + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * + * Generated from protobuf field bytes input_audio = 5; + */ + protected $input_audio = ''; + + /** + * @param string $session Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). Please see + * {@see SessionsClient::sessionName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\QueryInput $queryInput Required. The input specification. It can be set to: + * + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * + * 2. a conversational query in the form of text, or + * + * 3. an event that specifies which intent to trigger. + * + * @return \Google\Cloud\Dialogflow\V2\DetectIntentRequest + * + * @experimental + */ + public static function build(string $session, \Google\Cloud\Dialogflow\V2\QueryInput $queryInput): self + { + return (new self()) + ->setSession($session) + ->setQueryInput($queryInput); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * The parameters of this query. + * @type \Google\Cloud\Dialogflow\V2\QueryInput $query_input + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * @type \Google\Protobuf\FieldMask $output_audio_config_mask + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * @type string $input_audio + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * Required. The name of the session this query is sent to. Format: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\QueryInput|null + */ + public function getQueryInput() + { + return $this->query_input; + } + + public function hasQueryInput() + { + return isset($this->query_input); + } + + public function clearQueryInput() + { + unset($this->query_input); + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\QueryInput $var + * @return $this + */ + public function setQueryInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryInput::class); + $this->query_input = $var; + + return $this; + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 4; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 4; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @return \Google\Protobuf\FieldMask|null + */ + public function getOutputAudioConfigMask() + { + return $this->output_audio_config_mask; + } + + public function hasOutputAudioConfigMask() + { + return isset($this->output_audio_config_mask); + } + + public function clearOutputAudioConfigMask() + { + unset($this->output_audio_config_mask); + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setOutputAudioConfigMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->output_audio_config_mask = $var; + + return $this; + } + + /** + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * + * Generated from protobuf field bytes input_audio = 5; + * @return string + */ + public function getInputAudio() + { + return $this->input_audio; + } + + /** + * The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. + * A single request can contain up to 1 minute of speech audio data. + * + * Generated from protobuf field bytes input_audio = 5; + * @param string $var + * @return $this + */ + public function setInputAudio($var) + { + GPBUtil::checkString($var, False); + $this->input_audio = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php new file mode 100644 index 000000000000..65e071b8d5d2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php @@ -0,0 +1,273 @@ +google.cloud.dialogflow.v2.DetectIntentResponse + */ +class DetectIntentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + */ + protected $response_id = ''; + /** + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + */ + protected $query_result = null; + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 3; + */ + protected $webhook_status = null; + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 4; + */ + protected $output_audio = ''; + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + */ + protected $output_audio_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response_id + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * @type \Google\Rpc\Status $webhook_status + * Specifies the status of the webhook request. + * @type string $output_audio + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * The config used by the speech synthesizer to generate the output audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @return string + */ + public function getResponseId() + { + return $this->response_id; + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @param string $var + * @return $this + */ + public function setResponseId($var) + { + GPBUtil::checkString($var, True); + $this->response_id = $var; + + return $this; + } + + /** + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->query_result; + } + + public function hasQueryResult() + { + return isset($this->query_result); + } + + public function clearQueryResult() + { + unset($this->query_result); + } + + /** + * The selected results of the conversational query or event processing. + * See `alternative_query_results` for additional potential results. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->query_result = $var; + + return $this; + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 3; + * @return \Google\Rpc\Status|null + */ + public function getWebhookStatus() + { + return $this->webhook_status; + } + + public function hasWebhookStatus() + { + return isset($this->webhook_status); + } + + public function clearWebhookStatus() + { + unset($this->webhook_status); + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setWebhookStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->webhook_status = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 4; + * @return string + */ + public function getOutputAudio() + { + return $this->output_audio; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 4; + * @param string $var + * @return $this + */ + public function setOutputAudio($var) + { + GPBUtil::checkString($var, False); + $this->output_audio = $var; + + return $this; + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php new file mode 100644 index 000000000000..958e510574da --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.DialogflowAssistAnswer + */ +class DialogflowAssistAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + */ + protected $answer_record = ''; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * Result from v2 agent. + * @type \Google\Cloud\Dialogflow\V2\IntentSuggestion $intent_suggestion + * An intent suggestion generated from conversation. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Result from v2 agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->readOneof(1); + } + + public function hasQueryResult() + { + return $this->hasOneof(1); + } + + /** + * Result from v2 agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An intent suggestion generated from conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; + * @return \Google\Cloud\Dialogflow\V2\IntentSuggestion|null + */ + public function getIntentSuggestion() + { + return $this->readOneof(5); + } + + public function hasIntentSuggestion() + { + return $this->hasOneof(5); + } + + /** + * An intent suggestion generated from conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; + * @param \Google\Cloud\Dialogflow\V2\IntentSuggestion $var + * @return $this + */ + public function setIntentSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentSuggestion::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php new file mode 100644 index 000000000000..b934ec7e2fe7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php @@ -0,0 +1,500 @@ +google.cloud.dialogflow.v2.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The MIME type of this document. + * + * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mime_type = ''; + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $knowledge_types; + /** + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * + * Generated from protobuf field bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_auto_reload = false; + /** + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $latest_reload_status = null; + /** + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metadata; + /** + * Output only. The current state of the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * @type string $display_name + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * @type string $mime_type + * Required. The MIME type of this document. + * @type int[] $knowledge_types + * Required. The knowledge type of document content. + * @type string $content_uri + * The URI where the file content is located. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * NOTE: External URLs must correspond to public webpages, i.e., they must + * be indexed by Google Search. In particular, URLs for showing documents in + * Google Cloud Storage (i.e. the URL in your browser) are not supported. + * Instead use the `gs://` format URI described above. + * @type string $raw_content + * The raw content of the document. This field is only permitted for + * EXTRACTIVE_QA and FAQ knowledge types. + * @type bool $enable_auto_reload + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * @type \Google\Cloud\Dialogflow\V2\Document\ReloadStatus $latest_reload_status + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * @type int $state + * Output only. The current state of the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The document resource name. + * The name must be empty when creating a document. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The MIME type of this document. + * + * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Required. The MIME type of this document. + * + * Generated from protobuf field string mime_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getKnowledgeTypes() + { + return $this->knowledge_types; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int[] $var + * @return $this + */ + public function setKnowledgeTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Document\KnowledgeType::class); + $this->knowledge_types = $arr; + + return $this; + } + + /** + * The URI where the file content is located. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * NOTE: External URLs must correspond to public webpages, i.e., they must + * be indexed by Google Search. In particular, URLs for showing documents in + * Google Cloud Storage (i.e. the URL in your browser) are not supported. + * Instead use the `gs://` format URI described above. + * + * Generated from protobuf field string content_uri = 5; + * @return string + */ + public function getContentUri() + { + return $this->readOneof(5); + } + + public function hasContentUri() + { + return $this->hasOneof(5); + } + + /** + * The URI where the file content is located. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * NOTE: External URLs must correspond to public webpages, i.e., they must + * be indexed by Google Search. In particular, URLs for showing documents in + * Google Cloud Storage (i.e. the URL in your browser) are not supported. + * Instead use the `gs://` format URI described above. + * + * Generated from protobuf field string content_uri = 5; + * @param string $var + * @return $this + */ + public function setContentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The raw content of the document. This field is only permitted for + * EXTRACTIVE_QA and FAQ knowledge types. + * + * Generated from protobuf field bytes raw_content = 9; + * @return string + */ + public function getRawContent() + { + return $this->readOneof(9); + } + + public function hasRawContent() + { + return $this->hasOneof(9); + } + + /** + * The raw content of the document. This field is only permitted for + * EXTRACTIVE_QA and FAQ knowledge types. + * + * Generated from protobuf field bytes raw_content = 9; + * @param string $var + * @return $this + */ + public function setRawContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * + * Generated from protobuf field bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutoReload() + { + return $this->enable_auto_reload; + } + + /** + * Optional. If true, we try to automatically reload the document every day + * (at a time picked by the system). If false or unspecified, we don't try + * to automatically reload the document. + * Currently you can only enable automatic reload for documents sourced from + * a public url, see `source` field for the source types. + * Reload status can be tracked in `latest_reload_status`. If a reload + * fails, we will keep the document unchanged. + * If a reload fails with internal errors, the system will try to reload the + * document on the next day. + * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + * system will not try to reload the document anymore. You need to manually + * reload the document successfully by calling `ReloadDocument` and clear the + * errors. + * + * Generated from protobuf field bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutoReload($var) + { + GPBUtil::checkBool($var); + $this->enable_auto_reload = $var; + + return $this; + } + + /** + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\Document\ReloadStatus|null + */ + public function getLatestReloadStatus() + { + return $this->latest_reload_status; + } + + public function hasLatestReloadStatus() + { + return isset($this->latest_reload_status); + } + + public function clearLatestReloadStatus() + { + unset($this->latest_reload_status); + } + + /** + * Output only. The time and status of the latest reload. + * This reload may have been triggered automatically or manually + * and may not have succeeded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Document\ReloadStatus $var + * @return $this + */ + public function setLatestReloadStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Document\ReloadStatus::class); + $this->latest_reload_status = $var; + + return $this; + } + + /** + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Optional. Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * Output only. The current state of the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Document\State::class); + $this->state = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php new file mode 100644 index 000000000000..9dc8e4541e8f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.Document.KnowledgeType + */ +class KnowledgeType +{ + /** + * The type is unspecified or arbitrary. + * + * Generated from protobuf enum KNOWLEDGE_TYPE_UNSPECIFIED = 0; + */ + const KNOWLEDGE_TYPE_UNSPECIFIED = 0; + /** + * The document content contains question and answer pairs as either HTML or + * CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats + * may fail to be parsed. + * CSV must have questions in the first column and answers in the second, + * with no header. Because of this explicit format, they are always parsed + * accurately. + * + * Generated from protobuf enum FAQ = 1; + */ + const FAQ = 1; + /** + * Documents for which unstructured text is extracted and used for + * question answering. + * + * Generated from protobuf enum EXTRACTIVE_QA = 2; + */ + const EXTRACTIVE_QA = 2; + /** + * The entire document content as a whole can be used for query results. + * Only for Contact Center Solutions on Dialogflow. + * + * Generated from protobuf enum ARTICLE_SUGGESTION = 3; + */ + const ARTICLE_SUGGESTION = 3; + /** + * The document contains agent-facing Smart Reply entries. + * + * Generated from protobuf enum AGENT_FACING_SMART_REPLY = 4; + */ + const AGENT_FACING_SMART_REPLY = 4; + + private static $valueToName = [ + self::KNOWLEDGE_TYPE_UNSPECIFIED => 'KNOWLEDGE_TYPE_UNSPECIFIED', + self::FAQ => 'FAQ', + self::EXTRACTIVE_QA => 'EXTRACTIVE_QA', + self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', + self::AGENT_FACING_SMART_REPLY => 'AGENT_FACING_SMART_REPLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php new file mode 100644 index 000000000000..f07df4159a7e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.Document.ReloadStatus + */ +class ReloadStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 1; + */ + protected $time = null; + /** + * The status of a reload attempt or the initial load. + * + * Generated from protobuf field .google.rpc.Status status = 2; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $time + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * @type \Google\Rpc\Status $status + * The status of a reload attempt or the initial load. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTime() + { + return $this->time; + } + + public function hasTime() + { + return isset($this->time); + } + + public function clearTime() + { + unset($this->time); + } + + /** + * The time of a reload attempt. + * This reload may have been triggered automatically or manually and may + * not have succeeded. + * + * Generated from protobuf field .google.protobuf.Timestamp time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->time = $var; + + return $this; + } + + /** + * The status of a reload attempt or the initial load. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of a reload attempt or the initial load. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php new file mode 100644 index 000000000000..9053f27b6769 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.Document.State + */ +class State +{ + /** + * The document state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The document creation is in progress. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The document is active and ready to use. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The document updation is in progress. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * The document is reloading. + * + * Generated from protobuf enum RELOADING = 4; + */ + const RELOADING = 4; + /** + * The document deletion is in progress. + * + * Generated from protobuf enum DELETING = 5; + */ + const DELETING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::UPDATING => 'UPDATING', + self::RELOADING => 'RELOADING', + self::DELETING => 'DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php new file mode 100644 index 000000000000..d660d26c27c1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.DtmfParameters + */ +class DtmfParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether DTMF input can be handled in the next request. + * + * Generated from protobuf field bool accepts_dtmf_input = 1; + */ + protected $accepts_dtmf_input = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $accepts_dtmf_input + * Indicates whether DTMF input can be handled in the next request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether DTMF input can be handled in the next request. + * + * Generated from protobuf field bool accepts_dtmf_input = 1; + * @return bool + */ + public function getAcceptsDtmfInput() + { + return $this->accepts_dtmf_input; + } + + /** + * Indicates whether DTMF input can be handled in the next request. + * + * Generated from protobuf field bool accepts_dtmf_input = 1; + * @param bool $var + * @return $this + */ + public function setAcceptsDtmfInput($var) + { + GPBUtil::checkBool($var); + $this->accepts_dtmf_input = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php new file mode 100644 index 000000000000..5a494363bbc4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php @@ -0,0 +1,126 @@ +google.cloud.dialogflow.v2.EncryptionSpec + */ +class EncryptionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * @type string $kms_key + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php new file mode 100644 index 000000000000..6811a31317df --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php @@ -0,0 +1,274 @@ +google.cloud.dialogflow.v2.EntityType + */ +class EntityType extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the entity type. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. Indicates the kind of entity type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kind = 0; + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.AutoExpansionMode auto_expansion_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $auto_expansion_mode = 0; + /** + * Optional. The collection of entity entries associated with the entity type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $entities; + /** + * Optional. Enables fuzzy entity extraction during classification. + * + * Generated from protobuf field bool enable_fuzzy_extraction = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_fuzzy_extraction = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * @type string $display_name + * Required. The name of the entity type. + * @type int $kind + * Required. Indicates the kind of entity type. + * @type int $auto_expansion_mode + * Optional. Indicates whether the entity type can be automatically + * expanded. + * @type \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities + * Optional. The collection of entity entries associated with the entity type. + * @type bool $enable_fuzzy_extraction + * Optional. Enables fuzzy entity extraction during classification. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of the entity type. + * Required for + * [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType] + * and + * [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes] + * methods. Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the entity type. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the entity type. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. Indicates the kind of entity type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * Required. Indicates the kind of entity type. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.Kind kind = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\EntityType\Kind::class); + $this->kind = $var; + + return $this; + } + + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.AutoExpansionMode auto_expansion_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAutoExpansionMode() + { + return $this->auto_expansion_mode; + } + + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType.AutoExpansionMode auto_expansion_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAutoExpansionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\EntityType\AutoExpansionMode::class); + $this->auto_expansion_mode = $var; + + return $this; + } + + /** + * Optional. The collection of entity entries associated with the entity type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType\Entity> + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Optional. The collection of entity entries associated with the entity type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Optional. Enables fuzzy entity extraction during classification. + * + * Generated from protobuf field bool enable_fuzzy_extraction = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableFuzzyExtraction() + { + return $this->enable_fuzzy_extraction; + } + + /** + * Optional. Enables fuzzy entity extraction during classification. + * + * Generated from protobuf field bool enable_fuzzy_extraction = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableFuzzyExtraction($var) + { + GPBUtil::checkBool($var); + $this->enable_fuzzy_extraction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php new file mode 100644 index 000000000000..82d9ff3dadd6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php @@ -0,0 +1,57 @@ +google.cloud.dialogflow.v2.EntityType.AutoExpansionMode + */ +class AutoExpansionMode +{ + /** + * Auto expansion disabled for the entity. + * + * Generated from protobuf enum AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + */ + const AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + /** + * Allows an agent to recognize values that have not been explicitly + * listed in the entity. + * + * Generated from protobuf enum AUTO_EXPANSION_MODE_DEFAULT = 1; + */ + const AUTO_EXPANSION_MODE_DEFAULT = 1; + + private static $valueToName = [ + self::AUTO_EXPANSION_MODE_UNSPECIFIED => 'AUTO_EXPANSION_MODE_UNSPECIFIED', + self::AUTO_EXPANSION_MODE_DEFAULT => 'AUTO_EXPANSION_MODE_DEFAULT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php new file mode 100644 index 000000000000..86c7144ca04d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php @@ -0,0 +1,145 @@ +google.cloud.dialogflow.v2.EntityType.Entity + */ +class Entity extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * + * Generated from protobuf field string value = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = ''; + /** + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * @type string[] $synonyms + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * + * Generated from protobuf field string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * For `KIND_MAP` entity types: + * * A reference value to be used in place of synonyms. + * For `KIND_LIST` entity types: + * * A string that can contain references to other entity types (with or + * without aliases). + * + * Generated from protobuf field string value = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Required. A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * For `KIND_LIST` entity types: + * * This collection must contain exactly one synonym equal to `value`. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php new file mode 100644 index 000000000000..b89fdc6d8746 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.EntityType.Kind + */ +class Kind +{ + /** + * Not specified. This value should be never used. + * + * Generated from protobuf enum KIND_UNSPECIFIED = 0; + */ + const KIND_UNSPECIFIED = 0; + /** + * Map entity types allow mapping of a group of synonyms to a reference + * value. + * + * Generated from protobuf enum KIND_MAP = 1; + */ + const KIND_MAP = 1; + /** + * List entity types contain a set of entries that do not map to reference + * values. However, list entity types can contain references to other entity + * types (with or without aliases). + * + * Generated from protobuf enum KIND_LIST = 2; + */ + const KIND_LIST = 2; + /** + * Regexp entity types allow to specify regular expressions in entries + * values. + * + * Generated from protobuf enum KIND_REGEXP = 3; + */ + const KIND_REGEXP = 3; + + private static $valueToName = [ + self::KIND_UNSPECIFIED => 'KIND_UNSPECIFIED', + self::KIND_MAP => 'KIND_MAP', + self::KIND_LIST => 'KIND_LIST', + self::KIND_REGEXP => 'KIND_REGEXP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php new file mode 100644 index 000000000000..d2888549d782 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.EntityTypeBatch + */ +class EntityTypeBatch extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + */ + private $entity_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EntityType[] $entity_types + * A collection of entity types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * A collection of entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType> + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * A collection of entity types. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @param \Google\Cloud\Dialogflow\V2\EntityType[] $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php new file mode 100644 index 000000000000..7fc52b98cf45 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php @@ -0,0 +1,362 @@ +google.cloud.dialogflow.v2.Environment + */ +class Environment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $agent_version = ''; + /** + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Text to speech settings for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextToSpeechSettings text_to_speech_settings = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text_to_speech_settings = null; + /** + * Optional. The fulfillment settings to use for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fulfillment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * @type string $description + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * @type string $agent_version + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @type int $state + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * @type \Google\Cloud\Dialogflow\V2\TextToSpeechSettings $text_to_speech_settings + * Optional. Text to speech settings for this environment. + * @type \Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment + * Optional. The fulfillment settings to use for this environment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this agent environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The developer-provided description for this environment. + * The maximum length is 500 characters. If exceeded, the request is rejected. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAgentVersion() + { + return $this->agent_version; + } + + /** + * Optional. The agent version loaded into this environment. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string agent_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgentVersion($var) + { + GPBUtil::checkString($var, True); + $this->agent_version = $var; + + return $this; + } + + /** + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of this environment. This field is read-only, i.e., + * it cannot be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Environment\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last update time of this environment. This field is + * read-only, i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Text to speech settings for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextToSpeechSettings text_to_speech_settings = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\TextToSpeechSettings|null + */ + public function getTextToSpeechSettings() + { + return $this->text_to_speech_settings; + } + + public function hasTextToSpeechSettings() + { + return isset($this->text_to_speech_settings); + } + + public function clearTextToSpeechSettings() + { + unset($this->text_to_speech_settings); + } + + /** + * Optional. Text to speech settings for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextToSpeechSettings text_to_speech_settings = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\TextToSpeechSettings $var + * @return $this + */ + public function setTextToSpeechSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextToSpeechSettings::class); + $this->text_to_speech_settings = $var; + + return $this; + } + + /** + * Optional. The fulfillment settings to use for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Fulfillment|null + */ + public function getFulfillment() + { + return $this->fulfillment; + } + + public function hasFulfillment() + { + return isset($this->fulfillment); + } + + public function clearFulfillment() + { + unset($this->fulfillment); + } + + /** + * Optional. The fulfillment settings to use for this environment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment $var + * @return $this + */ + public function setFulfillment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Fulfillment::class); + $this->fulfillment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php new file mode 100644 index 000000000000..fc4462d0e561 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.Environment.State + */ +class State +{ + /** + * Not specified. This value is not used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Stopped. + * + * Generated from protobuf enum STOPPED = 1; + */ + const STOPPED = 1; + /** + * Loading. + * + * Generated from protobuf enum LOADING = 2; + */ + const LOADING = 2; + /** + * Running. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::STOPPED => 'STOPPED', + self::LOADING => 'LOADING', + self::RUNNING => 'RUNNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php new file mode 100644 index 000000000000..d063c835155b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php @@ -0,0 +1,164 @@ +google.cloud.dialogflow.v2.EnvironmentHistory + */ +class EnvironmentHistory extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parent = ''; + /** + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $entries; + /** + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * @type \Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry[] $entries + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * @type string $next_page_token + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Output only. The name of the environment this history is for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry> + */ + public function getEntries() + { + return $this->entries; + } + + /** + * Output only. The list of agent environments. There will be a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry[] $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry::class); + $this->entries = $arr; + + return $this; + } + + /** + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. Token to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php new file mode 100644 index 000000000000..e01a93d792fd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php @@ -0,0 +1,145 @@ +google.cloud.dialogflow.v2.EnvironmentHistory.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * The agent version loaded into this environment history entry. + * + * Generated from protobuf field string agent_version = 1; + */ + protected $agent_version = ''; + /** + * The developer-provided description for this environment history entry. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The creation time of this environment history entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent_version + * The agent version loaded into this environment history entry. + * @type string $description + * The developer-provided description for this environment history entry. + * @type \Google\Protobuf\Timestamp $create_time + * The creation time of this environment history entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * The agent version loaded into this environment history entry. + * + * Generated from protobuf field string agent_version = 1; + * @return string + */ + public function getAgentVersion() + { + return $this->agent_version; + } + + /** + * The agent version loaded into this environment history entry. + * + * Generated from protobuf field string agent_version = 1; + * @param string $var + * @return $this + */ + public function setAgentVersion($var) + { + GPBUtil::checkString($var, True); + $this->agent_version = $var; + + return $this; + } + + /** + * The developer-provided description for this environment history entry. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The developer-provided description for this environment history entry. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The creation time of this environment history entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The creation time of this environment history entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php new file mode 100644 index 000000000000..dab061b5472f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.EvaluationConfig + */ +class EvaluationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Datasets used for evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $datasets; + protected $model_specific_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InputDataset[] $datasets + * Required. Datasets used for evaluation. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig $smart_reply_config + * Configuration for smart reply model evaluation. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig $smart_compose_config + * Configuration for smart compose model evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. Datasets used for evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\InputDataset> + */ + public function getDatasets() + { + return $this->datasets; + } + + /** + * Required. Datasets used for evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\InputDataset[] $var + * @return $this + */ + public function setDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\InputDataset::class); + $this->datasets = $arr; + + return $this; + } + + /** + * Configuration for smart reply model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig smart_reply_config = 2; + * @return \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig|null + */ + public function getSmartReplyConfig() + { + return $this->readOneof(2); + } + + public function hasSmartReplyConfig() + { + return $this->hasOneof(2); + } + + /** + * Configuration for smart reply model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig smart_reply_config = 2; + * @param \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig $var + * @return $this + */ + public function setSmartReplyConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Configuration for smart compose model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig smart_compose_config = 4; + * @return \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig|null + */ + public function getSmartComposeConfig() + { + return $this->readOneof(4); + } + + public function hasSmartComposeConfig() + { + return $this->hasOneof(4); + } + + /** + * Configuration for smart compose model evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig smart_compose_config = 4; + * @param \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig $var + * @return $this + */ + public function setSmartComposeConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getModelSpecificConfig() + { + return $this->whichOneof("model_specific_config"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php new file mode 100644 index 000000000000..dbab5d59dc92 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig + */ +class SmartComposeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + */ + protected $allowlist_document = ''; + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_result_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $allowlist_document + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * @type int $max_result_count + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getAllowlistDocument() + { + return $this->allowlist_document; + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAllowlistDocument($var) + { + GPBUtil::checkString($var, True); + $this->allowlist_document = $var; + + return $this; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxResultCount() + { + return $this->max_result_count; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxResultCount($var) + { + GPBUtil::checkInt32($var); + $this->max_result_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php new file mode 100644 index 000000000000..1b3b977db057 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig + */ +class SmartReplyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + */ + protected $allowlist_document = ''; + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_result_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $allowlist_document + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * @type int $max_result_count + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getAllowlistDocument() + { + return $this->allowlist_document; + } + + /** + * The allowlist document resource name. + * Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + * + * Generated from protobuf field string allowlist_document = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAllowlistDocument($var) + { + GPBUtil::checkString($var, True); + $this->allowlist_document = $var; + + return $this; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMaxResultCount() + { + return $this->max_result_count; + } + + /** + * Required. The model to be evaluated can return multiple results with + * confidence score on each query. These results will be sorted by the + * descending order of the scores and we only keep the first + * max_result_count results as the final results to evaluate. + * + * Generated from protobuf field int32 max_result_count = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMaxResultCount($var) + { + GPBUtil::checkInt32($var); + $this->max_result_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationStatus.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationStatus.php new file mode 100644 index 000000000000..1d4a83878640 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationStatus.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.EvaluationStatus + */ +class EvaluationStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. If the value is `false`, it means the evaluation is still in + * progress. If `true`, the operation is completed, and either `error` or + * `response` is available. + * + * Generated from protobuf field optional bool done = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $done = null; + /** + * Output only. The error result of the evaluation in case of failure in + * evaluation pipeline. + * + * Generated from protobuf field .google.rpc.Status pipeline_status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $pipeline_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $done + * Output only. If the value is `false`, it means the evaluation is still in + * progress. If `true`, the operation is completed, and either `error` or + * `response` is available. + * @type \Google\Rpc\Status $pipeline_status + * Output only. The error result of the evaluation in case of failure in + * evaluation pipeline. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. If the value is `false`, it means the evaluation is still in + * progress. If `true`, the operation is completed, and either `error` or + * `response` is available. + * + * Generated from protobuf field optional bool done = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getDone() + { + return isset($this->done) ? $this->done : false; + } + + public function hasDone() + { + return isset($this->done); + } + + public function clearDone() + { + unset($this->done); + } + + /** + * Output only. If the value is `false`, it means the evaluation is still in + * progress. If `true`, the operation is completed, and either `error` or + * `response` is available. + * + * Generated from protobuf field optional bool done = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setDone($var) + { + GPBUtil::checkBool($var); + $this->done = $var; + + return $this; + } + + /** + * Output only. The error result of the evaluation in case of failure in + * evaluation pipeline. + * + * Generated from protobuf field .google.rpc.Status pipeline_status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getPipelineStatus() + { + return $this->pipeline_status; + } + + public function hasPipelineStatus() + { + return isset($this->pipeline_status); + } + + public function clearPipelineStatus() + { + unset($this->pipeline_status); + } + + /** + * Output only. The error result of the evaluation in case of failure in + * evaluation pipeline. + * + * Generated from protobuf field .google.rpc.Status pipeline_status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setPipelineStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->pipeline_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php new file mode 100644 index 000000000000..3d9b96e4008a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php @@ -0,0 +1,221 @@ +` can trigger a personalized welcome response. + * The parameter `name` may be used by the agent in the response: + * `"Hello #welcome_event.name! What can I do for you today?"`. + * + * Generated from protobuf message google.cloud.dialogflow.v2.EventInput + */ +class EventInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + */ + protected $parameters = null; + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the event. + * @type \Google\Protobuf\Struct $parameters + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * @type string $language_code + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php new file mode 100644 index 000000000000..df9f7bd17917 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.ExportAgentRequest + */ +class ExportAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $agent_uri = ''; + + /** + * @param string $parent Required. The project that the agent to export is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ExportAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * @type string $agent_uri + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAgentUri() + { + return $this->agent_uri; + } + + /** + * Required. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->agent_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php new file mode 100644 index 000000000000..cee7c9b761d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.ExportAgentResponse + */ +class ExportAgentResponse extends \Google\Protobuf\Internal\Message +{ + protected $agent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent_uri + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + * @type string $agent_content + * Zip compressed raw byte content for agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + * + * Generated from protobuf field string agent_uri = 1; + * @return string + */ + public function getAgentUri() + { + return $this->readOneof(1); + } + + public function hasAgentUri() + { + return $this->hasOneof(1); + } + + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + * + * Generated from protobuf field string agent_uri = 1; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 2; + * @return string + */ + public function getAgentContent() + { + return $this->readOneof(2); + } + + public function hasAgentContent() + { + return $this->hasOneof(2); + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 2; + * @param string $var + * @return $this + */ + public function setAgentContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgent() + { + return $this->whichOneof("agent"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php new file mode 100644 index 000000000000..3af50adfc9b1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php @@ -0,0 +1,194 @@ +google.cloud.dialogflow.v2.ExportDocumentRequest + */ +class ExportDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * When enabled, export the full content of the document including empirical + * probability. + * + * Generated from protobuf field bool export_full_content = 3; + */ + protected $export_full_content = false; + /** + * When enabled, export the smart messaging allowlist document for partial + * update. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5; + */ + protected $smart_messaging_partial_update = false; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * @type \Google\Cloud\Dialogflow\V2\GcsDestination $gcs_destination + * Cloud Storage file path to export the document. + * @type bool $export_full_content + * When enabled, export the full content of the document including empirical + * probability. + * @type bool $smart_messaging_partial_update + * When enabled, export the smart messaging allowlist document for partial + * update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Cloud Storage file path to export the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination gcs_destination = 2; + * @return \Google\Cloud\Dialogflow\V2\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(2); + } + + public function hasGcsDestination() + { + return $this->hasOneof(2); + } + + /** + * Cloud Storage file path to export the document. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination gcs_destination = 2; + * @param \Google\Cloud\Dialogflow\V2\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsDestination::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * When enabled, export the full content of the document including empirical + * probability. + * + * Generated from protobuf field bool export_full_content = 3; + * @return bool + */ + public function getExportFullContent() + { + return $this->export_full_content; + } + + /** + * When enabled, export the full content of the document including empirical + * probability. + * + * Generated from protobuf field bool export_full_content = 3; + * @param bool $var + * @return $this + */ + public function setExportFullContent($var) + { + GPBUtil::checkBool($var); + $this->export_full_content = $var; + + return $this; + } + + /** + * When enabled, export the smart messaging allowlist document for partial + * update. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5; + * @return bool + */ + public function getSmartMessagingPartialUpdate() + { + return $this->smart_messaging_partial_update; + } + + /** + * When enabled, export the smart messaging allowlist document for partial + * update. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5; + * @param bool $var + * @return $this + */ + public function setSmartMessagingPartialUpdate($var) + { + GPBUtil::checkBool($var); + $this->smart_messaging_partial_update = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php new file mode 100644 index 000000000000..60f5a86b0cea --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.ExportOperationMetadata + */ +class ExportOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Storage file path of the exported data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination exported_gcs_destination = 1; + */ + protected $exported_gcs_destination = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GcsDestination $exported_gcs_destination + * Cloud Storage file path of the exported data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Storage file path of the exported data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination exported_gcs_destination = 1; + * @return \Google\Cloud\Dialogflow\V2\GcsDestination|null + */ + public function getExportedGcsDestination() + { + return $this->exported_gcs_destination; + } + + public function hasExportedGcsDestination() + { + return isset($this->exported_gcs_destination); + } + + public function clearExportedGcsDestination() + { + unset($this->exported_gcs_destination); + } + + /** + * Cloud Storage file path of the exported data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsDestination exported_gcs_destination = 1; + * @param \Google\Cloud\Dialogflow\V2\GcsDestination $var + * @return $this + */ + public function setExportedGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsDestination::class); + $this->exported_gcs_destination = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php new file mode 100644 index 000000000000..38d95eeb8b25 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php @@ -0,0 +1,269 @@ +google.cloud.dialogflow.v2.FaqAnswer + */ +class FaqAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the `source` knowledge base document. + * + * Generated from protobuf field string answer = 1; + */ + protected $answer = ''; + /** + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 3; + */ + protected $question = ''; + /** + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * + * Generated from protobuf field string source = 4; + */ + protected $source = ''; + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + */ + private $metadata; + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer + * The piece of text from the `source` knowledge base document. + * @type float $confidence + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * @type string $question + * The corresponding FAQ question. + * @type string $source + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * A map that contains metadata about the answer and the + * document from which it originates. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the `source` knowledge base document. + * + * Generated from protobuf field string answer = 1; + * @return string + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * The piece of text from the `source` knowledge base document. + * + * Generated from protobuf field string answer = 1; + * @param string $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkString($var, True); + $this->answer = $var; + + return $this; + } + + /** + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The system's confidence score that this Knowledge answer is a good match + * for this conversational query, range from 0.0 (completely uncertain) + * to 1.0 (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 3; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 3; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * + * Generated from protobuf field string source = 4; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * Indicates which Knowledge Document this answer was extracted + * from. + * Format: `projects//locations//agent/knowledgeBases//documents/`. + * + * Generated from protobuf field string source = 4; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * A map that contains metadata about the answer and the + * document from which it originates. + * + * Generated from protobuf field map metadata = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 6; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php new file mode 100644 index 000000000000..551a329ac90c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php @@ -0,0 +1,206 @@ +google.cloud.dialogflow.v2.FewShotExample + */ +class FewShotExample extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_context = null; + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "\@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $extra_info; + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output = null; + protected $instruction_list; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context + * Optional. Conversation transcripts. + * @type array|\Google\Protobuf\Internal\MapField $extra_info + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "\@price", and ingested data has + * <"price", "10"> + * @type \Google\Cloud\Dialogflow\V2\SummarizationSectionList $summarization_section_list + * Summarization sections. + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $output + * Required. Example output of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null + */ + public function getConversationContext() + { + return $this->conversation_context; + } + + public function hasConversationContext() + { + return isset($this->conversation_context); + } + + public function clearConversationContext() + { + unset($this->conversation_context); + } + + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var + * @return $this + */ + public function setConversationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); + $this->conversation_context = $var; + + return $this; + } + + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "\@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExtraInfo() + { + return $this->extra_info; + } + + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "\@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExtraInfo($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->extra_info = $arr; + + return $this; + } + + /** + * Summarization sections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; + * @return \Google\Cloud\Dialogflow\V2\SummarizationSectionList|null + */ + public function getSummarizationSectionList() + { + return $this->readOneof(6); + } + + public function hasSummarizationSectionList() + { + return $this->hasOneof(6); + } + + /** + * Summarization sections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; + * @param \Google\Cloud\Dialogflow\V2\SummarizationSectionList $var + * @return $this + */ + public function setSummarizationSectionList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationSectionList::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getOutput() + { + return $this->output; + } + + public function hasOutput() + { + return isset($this->output); + } + + public function clearOutput() + { + unset($this->output); + } + + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setOutput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->output = $var; + + return $this; + } + + /** + * @return string + */ + public function getInstructionList() + { + return $this->whichOneof("instruction_list"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormContext.php new file mode 100644 index 000000000000..8cda76665e4f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormContext.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.FreeFormContext + */ +class FreeFormContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Free form text input to LLM. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Optional. Free form text input to LLM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Free form text input to LLM. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. Free form text input to LLM. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormSuggestion.php new file mode 100644 index 000000000000..f84d32641e13 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FreeFormSuggestion.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.FreeFormSuggestion + */ +class FreeFormSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Free form suggestion. + * + * Generated from protobuf field string response = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $response = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response + * Required. Free form suggestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. Free form suggestion. + * + * Generated from protobuf field string response = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResponse() + { + return $this->response; + } + + /** + * Required. Free form suggestion. + * + * Generated from protobuf field string response = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php new file mode 100644 index 000000000000..1efa5f9d1847 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php @@ -0,0 +1,247 @@ +google.cloud.dialogflow.v2.Fulfillment + */ +class Fulfillment extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. Whether fulfillment is enabled. + * + * Generated from protobuf field bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled = false; + /** + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Fulfillment.Feature features = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $features; + protected $fulfillment; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * @type string $display_name + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * @type \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService $generic_web_service + * Configuration for a generic web service. + * @type bool $enabled + * Optional. Whether fulfillment is enabled. + * @type \Google\Cloud\Dialogflow\V2\Fulfillment\Feature[] $features + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The human-readable name of the fulfillment, unique within the + * agent. + * This field is not used for Fulfillment in an Environment. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Configuration for a generic web service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.GenericWebService generic_web_service = 3; + * @return \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService|null + */ + public function getGenericWebService() + { + return $this->readOneof(3); + } + + public function hasGenericWebService() + { + return $this->hasOneof(3); + } + + /** + * Configuration for a generic web service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.GenericWebService generic_web_service = 3; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService $var + * @return $this + */ + public function setGenericWebService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Fulfillment\GenericWebService::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Whether fulfillment is enabled. + * + * Generated from protobuf field bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Optional. Whether fulfillment is enabled. + * + * Generated from protobuf field bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Fulfillment.Feature features = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature> + */ + public function getFeatures() + { + return $this->features; + } + + /** + * Optional. The field defines whether the fulfillment is enabled for certain + * features. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Fulfillment.Feature features = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment\Feature[] $var + * @return $this + */ + public function setFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Fulfillment\Feature::class); + $this->features = $arr; + + return $this; + } + + /** + * @return string + */ + public function getFulfillment() + { + return $this->whichOneof("fulfillment"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php new file mode 100644 index 000000000000..27b3e17657fa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Fulfillment.Feature + */ +class Feature extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the feature that enabled for fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.Feature.Type type = 1; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The type of the feature that enabled for fulfillment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * The type of the feature that enabled for fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.Feature.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the feature that enabled for fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment.Feature.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Fulfillment\Feature\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php new file mode 100644 index 000000000000..578a435a877f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php @@ -0,0 +1,54 @@ +google.cloud.dialogflow.v2.Fulfillment.Feature.Type + */ +class Type +{ + /** + * Feature type not specified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Fulfillment is enabled for SmallTalk. + * + * Generated from protobuf enum SMALLTALK = 1; + */ + const SMALLTALK = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::SMALLTALK => 'SMALLTALK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php new file mode 100644 index 000000000000..c155fcc73a19 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php @@ -0,0 +1,235 @@ +google.cloud.dialogflow.v2.Fulfillment.GenericWebService + */ +class GenericWebService extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + /** + * Optional. The user name for HTTP Basic authentication. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $username = ''; + /** + * Optional. The password for HTTP Basic authentication. + * + * Generated from protobuf field string password = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $password = ''; + /** + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * + * Generated from protobuf field map request_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_headers; + /** + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * + * Generated from protobuf field bool is_cloud_function = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $is_cloud_function = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * @type string $username + * Optional. The user name for HTTP Basic authentication. + * @type string $password + * Optional. The password for HTTP Basic authentication. + * @type array|\Google\Protobuf\Internal\MapField $request_headers + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * @type bool $is_cloud_function + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The fulfillment URI for receiving POST requests. + * It must use https protocol. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. The user name for HTTP Basic authentication. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Optional. The user name for HTTP Basic authentication. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Optional. The password for HTTP Basic authentication. + * + * Generated from protobuf field string password = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Optional. The password for HTTP Basic authentication. + * + * Generated from protobuf field string password = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + + /** + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * + * Generated from protobuf field map request_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRequestHeaders() + { + return $this->request_headers; + } + + /** + * Optional. The HTTP request headers to send together with fulfillment + * requests. + * + * Generated from protobuf field map request_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRequestHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->request_headers = $arr; + + return $this; + } + + /** + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * + * Generated from protobuf field bool is_cloud_function = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getIsCloudFunction() + { + if ($this->is_cloud_function !== false) { + @trigger_error('is_cloud_function is deprecated.', E_USER_DEPRECATED); + } + return $this->is_cloud_function; + } + + /** + * Optional. Indicates if generic web service is created through Cloud + * Functions integration. Defaults to false. + * is_cloud_function is deprecated. Cloud functions can be configured by + * its uri as a regular web service now. + * + * Generated from protobuf field bool is_cloud_function = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setIsCloudFunction($var) + { + @trigger_error('is_cloud_function is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->is_cloud_function = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php new file mode 100644 index 000000000000..dee1c295e559 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php @@ -0,0 +1,83 @@ +google.cloud.dialogflow.v2.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Gcs::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The Google Cloud Storage URIs for the output. A URI is of the + * form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. The requesting + * user must have "write-permission" to the bucket. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php new file mode 100644 index 000000000000..2106efe8be65 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.GcsSources + */ +class GcsSources extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * + * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $uris + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Gcs::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * + * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getUris() + { + return $this->uris; + } + + /** + * Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + * `gs://bucket/object-prefix-or-name` + * Whether a prefix or name is used depends on the use case. + * + * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php new file mode 100644 index 000000000000..abe074579724 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php @@ -0,0 +1,339 @@ +google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest + */ +class GenerateStatelessSuggestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $context_references; + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_context = null; + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $trigger_events; + /** + * Optional. Name of the CX SecuritySettings which is used to redact generated + * response. If this field is empty, try to fetch v2 security_settings, which + * is a project level setting. If this field is empty and no v2 + * security_settings set up in this project, no redaction will be done. + * Format: + * `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $security_settings = ''; + protected $generator_resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * @type string $generator_name + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * @type array|\Google\Protobuf\Internal\MapField $context_references + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context + * Optional. Context of the conversation, including transcripts. + * @type int[] $trigger_events + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * @type string $security_settings + * Optional. Name of the CX SecuritySettings which is used to redact generated + * response. If this field is empty, try to fetch v2 security_settings, which + * is a project level setting. If this field is empty and no v2 + * security_settings set up in this project, no redaction will be done. + * Format: + * `projects//locations//securitySettings/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->readOneof(2); + } + + public function hasGenerator() + { + return $this->hasOneof(2); + } + + /** + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 3; + * @return string + */ + public function getGeneratorName() + { + return $this->readOneof(3); + } + + public function hasGeneratorName() + { + return $this->hasOneof(3); + } + + /** + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 3; + * @param string $var + * @return $this + */ + public function setGeneratorName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getContextReferences() + { + return $this->context_references; + } + + /** + * Optional. A section of ingested context information. The key is the name of + * the context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->context_references = $arr; + + return $this; + } + + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null + */ + public function getConversationContext() + { + return $this->conversation_context; + } + + public function hasConversationContext() + { + return isset($this->conversation_context); + } + + public function clearConversationContext() + { + unset($this->conversation_context); + } + + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var + * @return $this + */ + public function setConversationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); + $this->conversation_context = $var; + + return $this; + } + + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getTriggerEvents() + { + return $this->trigger_events; + } + + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int[] $var + * @return $this + */ + public function setTriggerEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_events = $arr; + + return $this; + } + + /** + * Optional. Name of the CX SecuritySettings which is used to redact generated + * response. If this field is empty, try to fetch v2 security_settings, which + * is a project level setting. If this field is empty and no v2 + * security_settings set up in this project, no redaction will be done. + * Format: + * `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSecuritySettings() + { + return $this->security_settings; + } + + /** + * Optional. Name of the CX SecuritySettings which is used to redact generated + * response. If this field is empty, try to fetch v2 security_settings, which + * is a project level setting. If this field is empty and no v2 + * security_settings set up in this project, no redaction will be done. + * Format: + * `projects//locations//securitySettings/`. + * + * Generated from protobuf field string security_settings = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSecuritySettings($var) + { + GPBUtil::checkString($var, True); + $this->security_settings = $var; + + return $this; + } + + /** + * @return string + */ + public function getGeneratorResource() + { + return $this->whichOneof("generator_resource"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php new file mode 100644 index 000000000000..6b2fa19d5a54 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php @@ -0,0 +1,78 @@ +google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse + */ +class GenerateStatelessSuggestionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator_suggestion = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion + * Required. Generated suggestion for a conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getGeneratorSuggestion() + { + return $this->generator_suggestion; + } + + public function hasGeneratorSuggestion() + { + return isset($this->generator_suggestion); + } + + public function clearGeneratorSuggestion() + { + unset($this->generator_suggestion); + } + + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setGeneratorSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->generator_suggestion = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php new file mode 100644 index 000000000000..da59026723b7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php @@ -0,0 +1,222 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest + */ +class GenerateStatelessSummaryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $stateless_conversation = null; + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $stateless_conversation + * Required. The conversation to suggest a summary for. + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * @type string $latest_message + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * @type int $max_context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation|null + */ + public function getStatelessConversation() + { + return $this->stateless_conversation; + } + + public function hasStatelessConversation() + { + return isset($this->stateless_conversation); + } + + public function clearStatelessConversation() + { + unset($this->stateless_conversation); + } + + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $var + * @return $this + */ + public function setStatelessConversation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation::class); + $this->stateless_conversation = $var; + + return $this; + } + + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxContextSize() + { + return $this->max_context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxContextSize($var) + { + GPBUtil::checkInt32($var); + $this->max_context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php new file mode 100644 index 000000000000..197f3b69d4c4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation + */ +class MinimalConversation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $messages; + /** + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Message[] $messages + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * @type string $parent + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Message> + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Required. The messages that the Summary will be generated from. It is + * expected that this message content is already redacted and does not + * contain any PII. Required fields: {content, language_code, participant, + * participant_role} Optional fields: {send_time} If send_time is not + * provided, then the messages must be provided in chronological order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Message[] $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource to charge for the Summary's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php new file mode 100644 index 000000000000..28a5ae485ca9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php @@ -0,0 +1,174 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse + */ +class GenerateStatelessSummaryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary summary = 1; + */ + protected $summary = null; + /** + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary $summary + * Generated summary. + * @type string $latest_message + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary summary = 1; + * @return \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary|null + */ + public function getSummary() + { + return $this->summary; + } + + public function hasSummary() + { + return isset($this->summary); + } + + public function clearSummary() + { + unset($this->summary); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary summary = 1; + * @param \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse\Summary::class); + $this->summary = $var; + + return $this; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. The format is specific to the user and the names of + * the messages provided. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [GenerateStatelessSummaryRequest.max_context_size][google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.max_context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php new file mode 100644 index 000000000000..63c2bb503a83 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary + */ +class Summary extends \Google\Protobuf\Internal\Message +{ + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + */ + private $text_sections; + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The summary content that is concatenated into one string. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * @type string $baseline_model_version + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsRequest.php new file mode 100644 index 000000000000..92d67dfb9576 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsRequest.php @@ -0,0 +1,183 @@ +google.cloud.dialogflow.v2.GenerateSuggestionsRequest + */ +class GenerateSuggestionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $trigger_events; + + /** + * @param string $conversation Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GenerateSuggestionsRequest + * + * @experimental + */ + public static function build(string $conversation): self + { + return (new self()) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * @type string $latest_message + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * @type int[] $trigger_events + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. The conversation for which the suggestions are generated. Format: + * `projects//locations//conversations/`. + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message for which the request + * is triggered. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getTriggerEvents() + { + return $this->trigger_events; + } + + /** + * Optional. A list of trigger events. Only generators configured in the + * conversation_profile whose trigger_event is listed here will be triggered. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int[] $var + * @return $this + */ + public function setTriggerEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse.php new file mode 100644 index 000000000000..72e8964edce8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse.php @@ -0,0 +1,114 @@ +google.cloud.dialogflow.v2.GenerateSuggestionsResponse + */ +class GenerateSuggestionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The answers generated for the conversation based on context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer generator_suggestion_answers = 1; + */ + private $generator_suggestion_answers; + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer[] $generator_suggestion_answers + * The answers generated for the conversation based on context. + * @type string $latest_message + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The answers generated for the conversation based on context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer generator_suggestion_answers = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer> + */ + public function getGeneratorSuggestionAnswers() + { + return $this->generator_suggestion_answers; + } + + /** + * The answers generated for the conversation based on context. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer generator_suggestion_answers = 1; + * @param \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer[] $var + * @return $this + */ + public function setGeneratorSuggestionAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse\GeneratorSuggestionAnswer::class); + $this->generator_suggestion_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php new file mode 100644 index 000000000000..6b0a4bfa5afe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateSuggestionsResponse/GeneratorSuggestionAnswer.php @@ -0,0 +1,157 @@ +google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer + */ +class GeneratorSuggestionAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * Suggestion details. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1; + */ + protected $generator_suggestion = null; + /** + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * + * Generated from protobuf field string source_generator = 2; + */ + protected $source_generator = ''; + /** + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion + * Suggestion details. + * @type string $source_generator + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * @type string $answer_record + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Suggestion details. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getGeneratorSuggestion() + { + return $this->generator_suggestion; + } + + public function hasGeneratorSuggestion() + { + return isset($this->generator_suggestion); + } + + public function clearGeneratorSuggestion() + { + unset($this->generator_suggestion); + } + + /** + * Suggestion details. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setGeneratorSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->generator_suggestion = $var; + + return $this; + } + + /** + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * + * Generated from protobuf field string source_generator = 2; + * @return string + */ + public function getSourceGenerator() + { + return $this->source_generator; + } + + /** + * The name of the generator used to generate this suggestion. Format: + * `projects//locations//generators/`. + * + * Generated from protobuf field string source_generator = 2; + * @param string $var + * @return $this + */ + public function setSourceGenerator($var) + { + GPBUtil::checkString($var, True); + $this->source_generator = $var; + + return $this; + } + + /** + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Answer record that uniquely identifies the suggestion. This can be used + * to provide suggestion feedback. + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php new file mode 100644 index 000000000000..1ed88e19960e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php @@ -0,0 +1,625 @@ +google.cloud.dialogflow.v2.Generator + */ +class Generator extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $inference_parameter = null; + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $trigger_event = 0; + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Resource names of the tools that the generator can choose from. + * Format: `projects//locations//tools/`. + * + * Generated from protobuf field repeated string tools = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $tools; + /** + * Optional. Configuration for suggestion deduping. This is only applicable to + * AI Coach feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionDedupingConfig suggestion_deduping_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $suggestion_deduping_config = null; + /** + * Optional. List of CES toolset specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ToolsetTool toolset_tools = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $toolset_tools; + /** + * Optional. List of CES tool specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CesToolSpec ces_tool_specs = 28 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ces_tool_specs; + /** + * Optional. List of CES app specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CesAppSpec ces_app_specs = 29 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ces_app_specs; + protected $context; + protected $foundation_model; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * @type string $description + * Optional. Human readable description of the generator. + * @type \Google\Cloud\Dialogflow\V2\FreeFormContext $free_form_context + * Input of free from generator to LLM. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingContext $agent_coaching_context + * Input of prebuilt Agent Coaching feature. + * @type \Google\Cloud\Dialogflow\V2\SummarizationContext $summarization_context + * Input of prebuilt Summarization feature. + * @type \Google\Cloud\Dialogflow\V2\InferenceParameter $inference_parameter + * Optional. Inference parameters for this generator. + * @type int $trigger_event + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * @type string $published_model + * Optional. The published Large Language Model name. + * * To use the latest model version, specify the model name without version + * number. Example: `text-bison` + * * To use a stable model version, specify the version number as well. + * Example: `text-bison\@002`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this generator. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of this generator. + * @type string[] $tools + * Optional. Resource names of the tools that the generator can choose from. + * Format: `projects//locations//tools/`. + * @type \Google\Cloud\Dialogflow\V2\SuggestionDedupingConfig $suggestion_deduping_config + * Optional. Configuration for suggestion deduping. This is only applicable to + * AI Coach feature. + * @type \Google\Cloud\Dialogflow\V2\ToolsetTool[] $toolset_tools + * Optional. List of CES toolset specs that the generator can choose from. + * @type \Google\Cloud\Dialogflow\V2\CesToolSpec[] $ces_tool_specs + * Optional. List of CES tool specs that the generator can choose from. + * @type \Google\Cloud\Dialogflow\V2\CesAppSpec[] $ces_app_specs + * Optional. List of CES app specs that the generator can choose from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Input of free from generator to LLM. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormContext free_form_context = 11; + * @return \Google\Cloud\Dialogflow\V2\FreeFormContext|null + */ + public function getFreeFormContext() + { + return $this->readOneof(11); + } + + public function hasFreeFormContext() + { + return $this->hasOneof(11); + } + + /** + * Input of free from generator to LLM. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormContext free_form_context = 11; + * @param \Google\Cloud\Dialogflow\V2\FreeFormContext $var + * @return $this + */ + public function setFreeFormContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FreeFormContext::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Input of prebuilt Agent Coaching feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingContext agent_coaching_context = 12; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingContext|null + */ + public function getAgentCoachingContext() + { + return $this->readOneof(12); + } + + public function hasAgentCoachingContext() + { + return $this->hasOneof(12); + } + + /** + * Input of prebuilt Agent Coaching feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingContext agent_coaching_context = 12; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingContext $var + * @return $this + */ + public function setAgentCoachingContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingContext::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Input of prebuilt Summarization feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; + * @return \Google\Cloud\Dialogflow\V2\SummarizationContext|null + */ + public function getSummarizationContext() + { + return $this->readOneof(13); + } + + public function hasSummarizationContext() + { + return $this->hasOneof(13); + } + + /** + * Input of prebuilt Summarization feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; + * @param \Google\Cloud\Dialogflow\V2\SummarizationContext $var + * @return $this + */ + public function setSummarizationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationContext::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\InferenceParameter|null + */ + public function getInferenceParameter() + { + return $this->inference_parameter; + } + + public function hasInferenceParameter() + { + return isset($this->inference_parameter); + } + + public function clearInferenceParameter() + { + unset($this->inference_parameter); + } + + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\InferenceParameter $var + * @return $this + */ + public function setInferenceParameter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InferenceParameter::class); + $this->inference_parameter = $var; + + return $this; + } + + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTriggerEvent() + { + return $this->trigger_event; + } + + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTriggerEvent($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_event = $var; + + return $this; + } + + /** + * Optional. The published Large Language Model name. + * * To use the latest model version, specify the model name without version + * number. Example: `text-bison` + * * To use a stable model version, specify the version number as well. + * Example: `text-bison\@002`. + * + * Generated from protobuf field string published_model = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublishedModel() + { + return $this->readOneof(15); + } + + public function hasPublishedModel() + { + return $this->hasOneof(15); + } + + /** + * Optional. The published Large Language Model name. + * * To use the latest model version, specify the model name without version + * number. Example: `text-bison` + * * To use a stable model version, specify the version number as well. + * Example: `text-bison\@002`. + * + * Generated from protobuf field string published_model = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublishedModel($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Resource names of the tools that the generator can choose from. + * Format: `projects//locations//tools/`. + * + * Generated from protobuf field repeated string tools = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getTools() + { + return $this->tools; + } + + /** + * Optional. Resource names of the tools that the generator can choose from. + * Format: `projects//locations//tools/`. + * + * Generated from protobuf field repeated string tools = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setTools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tools = $arr; + + return $this; + } + + /** + * Optional. Configuration for suggestion deduping. This is only applicable to + * AI Coach feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionDedupingConfig suggestion_deduping_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SuggestionDedupingConfig|null + */ + public function getSuggestionDedupingConfig() + { + return $this->suggestion_deduping_config; + } + + public function hasSuggestionDedupingConfig() + { + return isset($this->suggestion_deduping_config); + } + + public function clearSuggestionDedupingConfig() + { + unset($this->suggestion_deduping_config); + } + + /** + * Optional. Configuration for suggestion deduping. This is only applicable to + * AI Coach feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionDedupingConfig suggestion_deduping_config = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SuggestionDedupingConfig $var + * @return $this + */ + public function setSuggestionDedupingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionDedupingConfig::class); + $this->suggestion_deduping_config = $var; + + return $this; + } + + /** + * Optional. List of CES toolset specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ToolsetTool toolset_tools = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ToolsetTool> + */ + public function getToolsetTools() + { + return $this->toolset_tools; + } + + /** + * Optional. List of CES toolset specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ToolsetTool toolset_tools = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ToolsetTool[] $var + * @return $this + */ + public function setToolsetTools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ToolsetTool::class); + $this->toolset_tools = $arr; + + return $this; + } + + /** + * Optional. List of CES tool specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CesToolSpec ces_tool_specs = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\CesToolSpec> + */ + public function getCesToolSpecs() + { + return $this->ces_tool_specs; + } + + /** + * Optional. List of CES tool specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CesToolSpec ces_tool_specs = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\CesToolSpec[] $var + * @return $this + */ + public function setCesToolSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\CesToolSpec::class); + $this->ces_tool_specs = $arr; + + return $this; + } + + /** + * Optional. List of CES app specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CesAppSpec ces_app_specs = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\CesAppSpec> + */ + public function getCesAppSpecs() + { + return $this->ces_app_specs; + } + + /** + * Optional. List of CES app specs that the generator can choose from. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CesAppSpec ces_app_specs = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\CesAppSpec[] $var + * @return $this + */ + public function setCesAppSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\CesAppSpec::class); + $this->ces_app_specs = $arr; + + return $this; + } + + /** + * @return string + */ + public function getContext() + { + return $this->whichOneof("context"); + } + + /** + * @return string + */ + public function getFoundationModel() + { + return $this->whichOneof("foundation_model"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php new file mode 100644 index 000000000000..fd8e70c32c7f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluation.php @@ -0,0 +1,503 @@ +google.cloud.dialogflow.v2.GeneratorEvaluation + */ +class GeneratorEvaluation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the evaluation. Format: + * `projects//locations//generators// + * evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. The display name of the generator evaluation. At most 64 bytes + * long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Required. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig generator_evaluation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator_evaluation_config = null; + /** + * Output only. Creation time of this generator evaluation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Completion time of this generator evaluation. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $complete_time = null; + /** + * Required. The initial generator that was used when creating this + * evaluation. This is a copy of the generator read from storage when creating + * the evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator initial_generator = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $initial_generator = null; + /** + * Output only. The result status of the evaluation pipeline. Provides the + * status information including if the evaluation is still in progress, + * completed or failed with certain error and user actionable message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationStatus evaluation_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $evaluation_status = null; + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. The field is an aggregated + * value of ZS status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * + * Generated from protobuf field optional bool satisfies_pzs = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. The field is an aggregated value of + * ZI status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * + * Generated from protobuf field optional bool satisfies_pzi = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + protected $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the evaluation. Format: + * `projects//locations//generators// + * evaluations/` + * @type string $display_name + * Optional. The display name of the generator evaluation. At most 64 bytes + * long. + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig $generator_evaluation_config + * Required. The configuration of the evaluation task. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this generator evaluation. + * @type \Google\Protobuf\Timestamp $complete_time + * Output only. Completion time of this generator evaluation. + * @type \Google\Cloud\Dialogflow\V2\Generator $initial_generator + * Required. The initial generator that was used when creating this + * evaluation. This is a copy of the generator read from storage when creating + * the evaluation. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics $summarization_metrics + * Output only. Only available when the summarization generator is provided. + * @type \Google\Cloud\Dialogflow\V2\EvaluationStatus $evaluation_status + * Output only. The result status of the evaluation pipeline. Provides the + * status information including if the evaluation is still in progress, + * completed or failed with certain error and user actionable message. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. The field is an aggregated + * value of ZS status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. The field is an aggregated value of + * ZI status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the evaluation. Format: + * `projects//locations//generators// + * evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the evaluation. Format: + * `projects//locations//generators// + * evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The display name of the generator evaluation. At most 64 bytes + * long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The display name of the generator evaluation. At most 64 bytes + * long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig generator_evaluation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig|null + */ + public function getGeneratorEvaluationConfig() + { + return $this->generator_evaluation_config; + } + + public function hasGeneratorEvaluationConfig() + { + return isset($this->generator_evaluation_config); + } + + public function clearGeneratorEvaluationConfig() + { + unset($this->generator_evaluation_config); + } + + /** + * Required. The configuration of the evaluation task. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig generator_evaluation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig $var + * @return $this + */ + public function setGeneratorEvaluationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig::class); + $this->generator_evaluation_config = $var; + + return $this; + } + + /** + * Output only. Creation time of this generator evaluation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this generator evaluation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Completion time of this generator evaluation. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompleteTime() + { + return $this->complete_time; + } + + public function hasCompleteTime() + { + return isset($this->complete_time); + } + + public function clearCompleteTime() + { + unset($this->complete_time); + } + + /** + * Output only. Completion time of this generator evaluation. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->complete_time = $var; + + return $this; + } + + /** + * Required. The initial generator that was used when creating this + * evaluation. This is a copy of the generator read from storage when creating + * the evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator initial_generator = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getInitialGenerator() + { + return $this->initial_generator; + } + + public function hasInitialGenerator() + { + return isset($this->initial_generator); + } + + public function clearInitialGenerator() + { + unset($this->initial_generator); + } + + /** + * Required. The initial generator that was used when creating this + * evaluation. This is a copy of the generator read from storage when creating + * the evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator initial_generator = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setInitialGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->initial_generator = $var; + + return $this; + } + + /** + * Output only. Only available when the summarization generator is provided. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics summarization_metrics = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics|null + */ + public function getSummarizationMetrics() + { + return $this->readOneof(6); + } + + public function hasSummarizationMetrics() + { + return $this->hasOneof(6); + } + + /** + * Output only. Only available when the summarization generator is provided. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics summarization_metrics = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics $var + * @return $this + */ + public function setSummarizationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. The result status of the evaluation pipeline. Provides the + * status information including if the evaluation is still in progress, + * completed or failed with certain error and user actionable message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationStatus evaluation_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\EvaluationStatus|null + */ + public function getEvaluationStatus() + { + return $this->evaluation_status; + } + + public function hasEvaluationStatus() + { + return isset($this->evaluation_status); + } + + public function clearEvaluationStatus() + { + unset($this->evaluation_status); + } + + /** + * Output only. The result status of the evaluation pipeline. Provides the + * status information including if the evaluation is still in progress, + * completed or failed with certain error and user actionable message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EvaluationStatus evaluation_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\EvaluationStatus $var + * @return $this + */ + public function setEvaluationStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EvaluationStatus::class); + $this->evaluation_status = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. The field is an aggregated + * value of ZS status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * + * Generated from protobuf field optional bool satisfies_pzs = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. The field is an aggregated + * value of ZS status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * + * Generated from protobuf field optional bool satisfies_pzs = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. The field is an aggregated value of + * ZI status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * + * Generated from protobuf field optional bool satisfies_pzi = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. The field is an aggregated value of + * ZI status of its underlying dependencies. See more details in + * go/zicy-resource-placement#resource-status + * + * Generated from protobuf field optional bool satisfies_pzi = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * @return string + */ + public function getMetrics() + { + return $this->whichOneof("metrics"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig.php new file mode 100644 index 000000000000..79b4284cc7cc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig + */ +class GeneratorEvaluationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The config/source of input data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig input_data_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_data_config = null; + /** + * Required. The output Cloud Storage bucket path to store eval files, e.g. + * per_summary_accuracy_score report. This path is provided by customer and + * files stored in it are visible to customer, no internal data should be + * stored in this path. + * + * Generated from protobuf field string output_gcs_bucket_path = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_gcs_bucket_path = ''; + protected $evaluation_feature_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\InputDataConfig $input_data_config + * Required. The config/source of input data. + * @type string $output_gcs_bucket_path + * Required. The output Cloud Storage bucket path to store eval files, e.g. + * per_summary_accuracy_score report. This path is provided by customer and + * files stored in it are visible to customer, no internal data should be + * stored in this path. + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\SummarizationConfig $summarization_config + * Evaluation configs for summarization generator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The config/source of input data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig input_data_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\InputDataConfig|null + */ + public function getInputDataConfig() + { + return $this->input_data_config; + } + + public function hasInputDataConfig() + { + return isset($this->input_data_config); + } + + public function clearInputDataConfig() + { + unset($this->input_data_config); + } + + /** + * Required. The config/source of input data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig input_data_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\InputDataConfig $var + * @return $this + */ + public function setInputDataConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\InputDataConfig::class); + $this->input_data_config = $var; + + return $this; + } + + /** + * Required. The output Cloud Storage bucket path to store eval files, e.g. + * per_summary_accuracy_score report. This path is provided by customer and + * files stored in it are visible to customer, no internal data should be + * stored in this path. + * + * Generated from protobuf field string output_gcs_bucket_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputGcsBucketPath() + { + return $this->output_gcs_bucket_path; + } + + /** + * Required. The output Cloud Storage bucket path to store eval files, e.g. + * per_summary_accuracy_score report. This path is provided by customer and + * files stored in it are visible to customer, no internal data should be + * stored in this path. + * + * Generated from protobuf field string output_gcs_bucket_path = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputGcsBucketPath($var) + { + GPBUtil::checkString($var, True); + $this->output_gcs_bucket_path = $var; + + return $this; + } + + /** + * Evaluation configs for summarization generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfig summarization_config = 3; + * @return \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\SummarizationConfig|null + */ + public function getSummarizationConfig() + { + return $this->readOneof(3); + } + + public function hasSummarizationConfig() + { + return $this->hasOneof(3); + } + + /** + * Evaluation configs for summarization generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfig summarization_config = 3; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\SummarizationConfig $var + * @return $this + */ + public function setSummarizationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\SummarizationConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getEvaluationFeatureConfig() + { + return $this->whichOneof("evaluation_feature_config"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/AgentAssistInputDataConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/AgentAssistInputDataConfig.php new file mode 100644 index 000000000000..364178393224 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/AgentAssistInputDataConfig.php @@ -0,0 +1,130 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfig + */ +class AgentAssistInputDataConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The start of the time range for conversations to be evaluated. + * Only conversations created at or after this timestamp will be sampled. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Required. The end of the time range for conversations to be evaluated. + * Only conversations ended at or before this timestamp will be sampled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Required. The start of the time range for conversations to be evaluated. + * Only conversations created at or after this timestamp will be sampled. + * @type \Google\Protobuf\Timestamp $end_time + * Required. The end of the time range for conversations to be evaluated. + * Only conversations ended at or before this timestamp will be sampled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The start of the time range for conversations to be evaluated. + * Only conversations created at or after this timestamp will be sampled. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. The start of the time range for conversations to be evaluated. + * Only conversations created at or after this timestamp will be sampled. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Required. The end of the time range for conversations to be evaluated. + * Only conversations ended at or before this timestamp will be sampled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Required. The end of the time range for conversations to be evaluated. + * Only conversations ended at or before this timestamp will be sampled. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/DatasetInputDataConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/DatasetInputDataConfig.php new file mode 100644 index 000000000000..f1e62fcb3cfc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/DatasetInputDataConfig.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfig + */ +class DatasetInputDataConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The identifier of the dataset to be evaluated. + * Format: + * `projects//locations//datasets/`. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Required. The identifier of the dataset to be evaluated. + * Format: + * `projects//locations//datasets/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The identifier of the dataset to be evaluated. + * Format: + * `projects//locations//datasets/`. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Required. The identifier of the dataset to be evaluated. + * Format: + * `projects//locations//datasets/`. + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig.php new file mode 100644 index 000000000000..8644825a028a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig.php @@ -0,0 +1,379 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig + */ +class InputDataConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The source type of input data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceType input_data_source_type = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * @deprecated + */ + protected $input_data_source_type = 0; + /** + * Optional. The start timestamp to fetch conversation data. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $start_time = null; + /** + * Optional. The end timestamp to fetch conversation data. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $end_time = null; + /** + * Optional. Desired number of conversation-summary pairs to be evaluated. + * + * Generated from protobuf field int32 sample_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_size = 0; + /** + * Optional. Whether the summary generation is allowed when the pre-existing + * qualified summaries are insufficient to cover the sample size. + * + * Generated from protobuf field bool is_summary_generation_allowed = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $is_summary_generation_allowed = false; + /** + * Optional. Option to control whether summaries are generated during + * evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOption summary_generation_option = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $summary_generation_option = 0; + protected $source_specific_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $input_data_source_type + * Required. The source type of input data. + * @type \Google\Protobuf\Timestamp $start_time + * Optional. The start timestamp to fetch conversation data. + * @type \Google\Protobuf\Timestamp $end_time + * Optional. The end timestamp to fetch conversation data. + * @type int $sample_size + * Optional. Desired number of conversation-summary pairs to be evaluated. + * @type bool $is_summary_generation_allowed + * Optional. Whether the summary generation is allowed when the pre-existing + * qualified summaries are insufficient to cover the sample size. + * @type int $summary_generation_option + * Optional. Option to control whether summaries are generated during + * evaluation. + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\AgentAssistInputDataConfig $agent_assist_input_data_config + * The distinctive configs for Agent Assist conversations as the + * conversation source. + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\DatasetInputDataConfig $dataset_input_data_config + * The distinctive configs for dataset as the conversation source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The source type of input data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceType input_data_source_type = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * @return int + * @deprecated + */ + public function getInputDataSourceType() + { + if ($this->input_data_source_type !== 0) { + @trigger_error('input_data_source_type is deprecated.', E_USER_DEPRECATED); + } + return $this->input_data_source_type; + } + + /** + * Required. The source type of input data. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceType input_data_source_type = 1 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + * @deprecated + */ + public function setInputDataSourceType($var) + { + @trigger_error('input_data_source_type is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\InputDataSourceType::class); + $this->input_data_source_type = $var; + + return $this; + } + + /** + * Optional. The start timestamp to fetch conversation data. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + * @deprecated + */ + public function getStartTime() + { + if (isset($this->start_time)) { + @trigger_error('start_time is deprecated.', E_USER_DEPRECATED); + } + return $this->start_time; + } + + public function hasStartTime() + { + if (isset($this->start_time)) { + @trigger_error('start_time is deprecated.', E_USER_DEPRECATED); + } + return isset($this->start_time); + } + + public function clearStartTime() + { + @trigger_error('start_time is deprecated.', E_USER_DEPRECATED); + unset($this->start_time); + } + + /** + * Optional. The start timestamp to fetch conversation data. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + * @deprecated + */ + public function setStartTime($var) + { + @trigger_error('start_time is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Optional. The end timestamp to fetch conversation data. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + * @deprecated + */ + public function getEndTime() + { + if (isset($this->end_time)) { + @trigger_error('end_time is deprecated.', E_USER_DEPRECATED); + } + return $this->end_time; + } + + public function hasEndTime() + { + if (isset($this->end_time)) { + @trigger_error('end_time is deprecated.', E_USER_DEPRECATED); + } + return isset($this->end_time); + } + + public function clearEndTime() + { + @trigger_error('end_time is deprecated.', E_USER_DEPRECATED); + unset($this->end_time); + } + + /** + * Optional. The end timestamp to fetch conversation data. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + * @deprecated + */ + public function setEndTime($var) + { + @trigger_error('end_time is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Optional. Desired number of conversation-summary pairs to be evaluated. + * + * Generated from protobuf field int32 sample_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSampleSize() + { + return $this->sample_size; + } + + /** + * Optional. Desired number of conversation-summary pairs to be evaluated. + * + * Generated from protobuf field int32 sample_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleSize($var) + { + GPBUtil::checkInt32($var); + $this->sample_size = $var; + + return $this; + } + + /** + * Optional. Whether the summary generation is allowed when the pre-existing + * qualified summaries are insufficient to cover the sample size. + * + * Generated from protobuf field bool is_summary_generation_allowed = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getIsSummaryGenerationAllowed() + { + if ($this->is_summary_generation_allowed !== false) { + @trigger_error('is_summary_generation_allowed is deprecated.', E_USER_DEPRECATED); + } + return $this->is_summary_generation_allowed; + } + + /** + * Optional. Whether the summary generation is allowed when the pre-existing + * qualified summaries are insufficient to cover the sample size. + * + * Generated from protobuf field bool is_summary_generation_allowed = 5 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setIsSummaryGenerationAllowed($var) + { + @trigger_error('is_summary_generation_allowed is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->is_summary_generation_allowed = $var; + + return $this; + } + + /** + * Optional. Option to control whether summaries are generated during + * evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOption summary_generation_option = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSummaryGenerationOption() + { + return $this->summary_generation_option; + } + + /** + * Optional. Option to control whether summaries are generated during + * evaluation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOption summary_generation_option = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSummaryGenerationOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\InputDataConfig\SummaryGenerationOption::class); + $this->summary_generation_option = $var; + + return $this; + } + + /** + * The distinctive configs for Agent Assist conversations as the + * conversation source. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfig agent_assist_input_data_config = 6; + * @return \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\AgentAssistInputDataConfig|null + */ + public function getAgentAssistInputDataConfig() + { + return $this->readOneof(6); + } + + public function hasAgentAssistInputDataConfig() + { + return $this->hasOneof(6); + } + + /** + * The distinctive configs for Agent Assist conversations as the + * conversation source. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfig agent_assist_input_data_config = 6; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\AgentAssistInputDataConfig $var + * @return $this + */ + public function setAgentAssistInputDataConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\AgentAssistInputDataConfig::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The distinctive configs for dataset as the conversation source. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfig dataset_input_data_config = 7; + * @return \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\DatasetInputDataConfig|null + */ + public function getDatasetInputDataConfig() + { + return $this->readOneof(7); + } + + public function hasDatasetInputDataConfig() + { + return $this->hasOneof(7); + } + + /** + * The distinctive configs for dataset as the conversation source. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfig dataset_input_data_config = 7; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\DatasetInputDataConfig $var + * @return $this + */ + public function setDatasetInputDataConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorEvaluationConfig\DatasetInputDataConfig::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getSourceSpecificConfig() + { + return $this->whichOneof("source_specific_config"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig/SummaryGenerationOption.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig/SummaryGenerationOption.php new file mode 100644 index 000000000000..702ac19ef9af --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataConfig/SummaryGenerationOption.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOption + */ +class SummaryGenerationOption +{ + /** + * Default option will not be used + * + * Generated from protobuf enum SUMMARY_GENERATION_OPTION_UNSPECIFIED = 0; + */ + const SUMMARY_GENERATION_OPTION_UNSPECIFIED = 0; + /** + * Always Generate summary for all conversations. + * + * Generated from protobuf enum ALWAYS_GENERATE = 1; + */ + const ALWAYS_GENERATE = 1; + /** + * Gnerate only missing summaries. + * + * Generated from protobuf enum GENERATE_IF_MISSING = 2; + */ + const GENERATE_IF_MISSING = 2; + /** + * Do not generate new summaries. Only use existing summaries found. + * + * Generated from protobuf enum DO_NOT_GENERATE = 3; + */ + const DO_NOT_GENERATE = 3; + + private static $valueToName = [ + self::SUMMARY_GENERATION_OPTION_UNSPECIFIED => 'SUMMARY_GENERATION_OPTION_UNSPECIFIED', + self::ALWAYS_GENERATE => 'ALWAYS_GENERATE', + self::GENERATE_IF_MISSING => 'GENERATE_IF_MISSING', + self::DO_NOT_GENERATE => 'DO_NOT_GENERATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataSourceType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataSourceType.php new file mode 100644 index 000000000000..ebd45143580f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/InputDataSourceType.php @@ -0,0 +1,65 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceType + */ +class InputDataSourceType +{ + /** + * Unspecified InputDataSourceType. Should not be used. + * + * Generated from protobuf enum INPUT_DATA_SOURCE_TYPE_UNSPECIFIED = 0; + */ + const INPUT_DATA_SOURCE_TYPE_UNSPECIFIED = 0; + /** + * Fetch data from Agent Assist storage. If this source type is chosen, + * input_data_config.start_time and input_data_config.end_timestamp must be + * provided. + * + * Generated from protobuf enum AGENT_ASSIST_CONVERSATIONS = 1; + */ + const AGENT_ASSIST_CONVERSATIONS = 1; + /** + * Fetch data from Insights storage. If this source type is chosen, + * input_data_config.start_time and input_data_config.end_timestamp must be + * provided. + * + * Generated from protobuf enum INSIGHTS_CONVERSATIONS = 2; + */ + const INSIGHTS_CONVERSATIONS = 2; + + private static $valueToName = [ + self::INPUT_DATA_SOURCE_TYPE_UNSPECIFIED => 'INPUT_DATA_SOURCE_TYPE_UNSPECIFIED', + self::AGENT_ASSIST_CONVERSATIONS => 'AGENT_ASSIST_CONVERSATIONS', + self::INSIGHTS_CONVERSATIONS => 'INSIGHTS_CONVERSATIONS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/SummarizationConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/SummarizationConfig.php new file mode 100644 index 000000000000..e24583b02509 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationConfig/SummarizationConfig.php @@ -0,0 +1,249 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfig + */ +class SummarizationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Enable accuracy evaluation. + * + * Generated from protobuf field bool enable_accuracy_evaluation = 1 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $enable_accuracy_evaluation = false; + /** + * Optional. Version for summarization accuracy. This will determine the + * prompt and model used at backend. + * + * Generated from protobuf field string accuracy_evaluation_version = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $accuracy_evaluation_version = ''; + /** + * Optional. Enable completeness evaluation. + * + * Generated from protobuf field bool enable_completeness_evaluation = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $enable_completeness_evaluation = false; + /** + * Optional. Version for summarization completeness. This will determine the + * prompt and model used at backend. + * + * Generated from protobuf field string completeness_evaluation_version = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $completeness_evaluation_version = ''; + /** + * Optional. Version for summarization evaluation. + * + * Generated from protobuf field optional string evaluator_version = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluator_version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_accuracy_evaluation + * Optional. Enable accuracy evaluation. + * @type string $accuracy_evaluation_version + * Optional. Version for summarization accuracy. This will determine the + * prompt and model used at backend. + * @type bool $enable_completeness_evaluation + * Optional. Enable completeness evaluation. + * @type string $completeness_evaluation_version + * Optional. Version for summarization completeness. This will determine the + * prompt and model used at backend. + * @type string $evaluator_version + * Optional. Version for summarization evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Enable accuracy evaluation. + * + * Generated from protobuf field bool enable_accuracy_evaluation = 1 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getEnableAccuracyEvaluation() + { + if ($this->enable_accuracy_evaluation !== false) { + @trigger_error('enable_accuracy_evaluation is deprecated.', E_USER_DEPRECATED); + } + return $this->enable_accuracy_evaluation; + } + + /** + * Optional. Enable accuracy evaluation. + * + * Generated from protobuf field bool enable_accuracy_evaluation = 1 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setEnableAccuracyEvaluation($var) + { + @trigger_error('enable_accuracy_evaluation is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->enable_accuracy_evaluation = $var; + + return $this; + } + + /** + * Optional. Version for summarization accuracy. This will determine the + * prompt and model used at backend. + * + * Generated from protobuf field string accuracy_evaluation_version = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getAccuracyEvaluationVersion() + { + if ($this->accuracy_evaluation_version !== '') { + @trigger_error('accuracy_evaluation_version is deprecated.', E_USER_DEPRECATED); + } + return $this->accuracy_evaluation_version; + } + + /** + * Optional. Version for summarization accuracy. This will determine the + * prompt and model used at backend. + * + * Generated from protobuf field string accuracy_evaluation_version = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setAccuracyEvaluationVersion($var) + { + @trigger_error('accuracy_evaluation_version is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->accuracy_evaluation_version = $var; + + return $this; + } + + /** + * Optional. Enable completeness evaluation. + * + * Generated from protobuf field bool enable_completeness_evaluation = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return bool + * @deprecated + */ + public function getEnableCompletenessEvaluation() + { + if ($this->enable_completeness_evaluation !== false) { + @trigger_error('enable_completeness_evaluation is deprecated.', E_USER_DEPRECATED); + } + return $this->enable_completeness_evaluation; + } + + /** + * Optional. Enable completeness evaluation. + * + * Generated from protobuf field bool enable_completeness_evaluation = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setEnableCompletenessEvaluation($var) + { + @trigger_error('enable_completeness_evaluation is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->enable_completeness_evaluation = $var; + + return $this; + } + + /** + * Optional. Version for summarization completeness. This will determine the + * prompt and model used at backend. + * + * Generated from protobuf field string completeness_evaluation_version = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getCompletenessEvaluationVersion() + { + if ($this->completeness_evaluation_version !== '') { + @trigger_error('completeness_evaluation_version is deprecated.', E_USER_DEPRECATED); + } + return $this->completeness_evaluation_version; + } + + /** + * Optional. Version for summarization completeness. This will determine the + * prompt and model used at backend. + * + * Generated from protobuf field string completeness_evaluation_version = 4 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setCompletenessEvaluationVersion($var) + { + @trigger_error('completeness_evaluation_version is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->completeness_evaluation_version = $var; + + return $this; + } + + /** + * Optional. Version for summarization evaluation. + * + * Generated from protobuf field optional string evaluator_version = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEvaluatorVersion() + { + return isset($this->evaluator_version) ? $this->evaluator_version : ''; + } + + public function hasEvaluatorVersion() + { + return isset($this->evaluator_version); + } + + public function clearEvaluatorVersion() + { + unset($this->evaluator_version); + } + + /** + * Optional. Version for summarization evaluation. + * + * Generated from protobuf field optional string evaluator_version = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEvaluatorVersion($var) + { + GPBUtil::checkString($var, True); + $this->evaluator_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationOperationMetadata.php new file mode 100644 index 000000000000..e38fca86aedd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorEvaluationOperationMetadata.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.GeneratorEvaluationOperationMetadata + */ +class GeneratorEvaluationOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the generator evaluation. Format: + * `projects//locations//generators//evaluations/` + * + * Generated from protobuf field string generator_evaluation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generator_evaluation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $generator_evaluation + * Output only. The resource name of the generator evaluation. Format: + * `projects//locations//generators//evaluations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the generator evaluation. Format: + * `projects//locations//generators//evaluations/` + * + * Generated from protobuf field string generator_evaluation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGeneratorEvaluation() + { + return $this->generator_evaluation; + } + + /** + * Output only. The resource name of the generator evaluation. Format: + * `projects//locations//generators//evaluations/` + * + * Generated from protobuf field string generator_evaluation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGeneratorEvaluation($var) + { + GPBUtil::checkString($var, True); + $this->generator_evaluation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php new file mode 100644 index 000000000000..168519632f74 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php @@ -0,0 +1,175 @@ +google.cloud.dialogflow.v2.GeneratorSuggestion + */ +class GeneratorSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of request and response for tool calls executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfo tool_call_info = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tool_call_info; + protected $suggestion; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\FreeFormSuggestion $free_form_suggestion + * Optional. Free form suggestion. + * @type \Google\Cloud\Dialogflow\V2\SummarySuggestion $summary_suggestion + * Optional. Suggested summary. + * @type \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion $agent_coaching_suggestion + * Optional. Suggestion to coach the agent. + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion\ToolCallInfo[] $tool_call_info + * Optional. List of request and response for tool calls executed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Free form suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormSuggestion free_form_suggestion = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\FreeFormSuggestion|null + */ + public function getFreeFormSuggestion() + { + return $this->readOneof(1); + } + + public function hasFreeFormSuggestion() + { + return $this->hasOneof(1); + } + + /** + * Optional. Free form suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FreeFormSuggestion free_form_suggestion = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\FreeFormSuggestion $var + * @return $this + */ + public function setFreeFormSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FreeFormSuggestion::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Suggested summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SummarySuggestion|null + */ + public function getSummarySuggestion() + { + return $this->readOneof(2); + } + + public function hasSummarySuggestion() + { + return $this->hasOneof(2); + } + + /** + * Optional. Suggested summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SummarySuggestion $var + * @return $this + */ + public function setSummarySuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarySuggestion::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Suggestion to coach the agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion agent_coaching_suggestion = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion|null + */ + public function getAgentCoachingSuggestion() + { + return $this->readOneof(3); + } + + public function hasAgentCoachingSuggestion() + { + return $this->hasOneof(3); + } + + /** + * Optional. Suggestion to coach the agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentCoachingSuggestion agent_coaching_suggestion = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion $var + * @return $this + */ + public function setAgentCoachingSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentCoachingSuggestion::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. List of request and response for tool calls executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfo tool_call_info = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\GeneratorSuggestion\ToolCallInfo> + */ + public function getToolCallInfo() + { + return $this->tool_call_info; + } + + /** + * Optional. List of request and response for tool calls executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfo tool_call_info = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion\ToolCallInfo[] $var + * @return $this + */ + public function setToolCallInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion\ToolCallInfo::class); + $this->tool_call_info = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSuggestion() + { + return $this->whichOneof("suggestion"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion/ToolCallInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion/ToolCallInfo.php new file mode 100644 index 000000000000..11134614edc5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion/ToolCallInfo.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfo + */ +class ToolCallInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Request for a tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCall tool_call = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tool_call = null; + /** + * Required. Response for a tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCallResult tool_call_result = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tool_call_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ToolCall $tool_call + * Required. Request for a tool call. + * @type \Google\Cloud\Dialogflow\V2\ToolCallResult $tool_call_result + * Required. Response for a tool call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. Request for a tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCall tool_call = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ToolCall|null + */ + public function getToolCall() + { + return $this->tool_call; + } + + public function hasToolCall() + { + return isset($this->tool_call); + } + + public function clearToolCall() + { + unset($this->tool_call); + } + + /** + * Required. Request for a tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCall tool_call = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ToolCall $var + * @return $this + */ + public function setToolCall($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ToolCall::class); + $this->tool_call = $var; + + return $this; + } + + /** + * Required. Response for a tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCallResult tool_call_result = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ToolCallResult|null + */ + public function getToolCallResult() + { + return $this->tool_call_result; + } + + public function hasToolCallResult() + { + return isset($this->tool_call_result); + } + + public function clearToolCallResult() + { + unset($this->tool_call_result); + } + + /** + * Required. Response for a tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCallResult tool_call_result = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ToolCallResult $var + * @return $this + */ + public function setToolCallResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ToolCallResult::class); + $this->tool_call_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php new file mode 100644 index 000000000000..f6303f10c0cb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.GetAgentRequest + */ +class GetAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The project that the agent to fetch is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php new file mode 100644 index 000000000000..5b27d8dca8af --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.GetContextRequest + */ +class GetContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetContextRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php new file mode 100644 index 000000000000..573d61bb33f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetConversationDatasetRequest + */ +class GetConversationDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationDatasetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php new file mode 100644 index 000000000000..ed8cd348fd4a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php @@ -0,0 +1,91 @@ +google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest + */ +class GetConversationModelEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationModelEvaluationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php new file mode 100644 index 000000000000..8fa3bc7f2886 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.GetConversationModelRequest + */ +class GetConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php new file mode 100644 index 000000000000..8302aa94ad54 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetConversationProfileRequest + */ +class GetConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationProfileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php new file mode 100644 index 000000000000..ff70b335a7dc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetConversationRequest + */ +class GetConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the conversation. Format: + * `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetConversationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php new file mode 100644 index 000000000000..81e1ebb00d94 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetDocumentRequest + */ +class GetDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetDocumentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php new file mode 100644 index 000000000000..d8b7835b0af2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php @@ -0,0 +1,81 @@ +google.cloud.dialogflow.v2.GetEncryptionSpecRequest + */ +class GetEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the encryption spec resource to get. Please see + * {@see EncryptionSpecServiceClient::encryptionSpecName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetEncryptionSpecRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the encryption spec resource to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php new file mode 100644 index 000000000000..bcf46ef661c9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.GetEntityTypeRequest + */ +class GetEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * @param string $name Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * @param string $name Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\GetEntityTypeRequest + * + * @experimental + */ + public static function buildFromNameLanguageCode(string $name, string $languageCode): self + { + return (new self()) + ->setName($name) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php new file mode 100644 index 000000000000..7b84bc2e93b9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php @@ -0,0 +1,160 @@ +google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest + */ +class GetEnvironmentHistoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php new file mode 100644 index 000000000000..9a62b2552eb9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php @@ -0,0 +1,88 @@ +google.cloud.dialogflow.v2.GetEnvironmentRequest + */ +class GetEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * The environment ID for the default environment is `-`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php new file mode 100644 index 000000000000..73980e36bb0b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.GetFulfillmentRequest + */ +class GetFulfillmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. Please see + * {@see FulfillmentsClient::fulfillmentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetFulfillmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorEvaluationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorEvaluationRequest.php new file mode 100644 index 000000000000..660a28f44328 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorEvaluationRequest.php @@ -0,0 +1,91 @@ +google.cloud.dialogflow.v2.GetGeneratorEvaluationRequest + */ +class GetGeneratorEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator evaluation resource name. Format: + * `projects//locations//generators//evaluations/` + * Please see {@see GeneratorEvaluationsClient::generatorEvaluationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetGeneratorEvaluationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators//evaluations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator evaluation resource name. Format: + * `projects//locations//generators//evaluations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php new file mode 100644 index 000000000000..2b7fc9d79151 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.GetGeneratorRequest + */ +class GetGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetGeneratorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php new file mode 100644 index 000000000000..2fa7fc97903a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php @@ -0,0 +1,192 @@ +google.cloud.dialogflow.v2.GetIntentRequest + */ +class GetIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + + /** + * @param string $name Required. The name of the intent. + * Format: `projects//agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetIntentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * @param string $name Required. The name of the intent. + * Format: `projects//agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\GetIntentRequest + * + * @experimental + */ + public static function buildFromNameLanguageCode(string $name, string $languageCode): self + { + return (new self()) + ->setName($name) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php new file mode 100644 index 000000000000..344cf3d0a4e1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + */ +class GetKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetKnowledgeBaseRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php new file mode 100644 index 000000000000..933e1d828140 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetParticipantRequest + */ +class GetParticipantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetParticipantRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php new file mode 100644 index 000000000000..ea6e9f0f98fe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.GetSessionEntityTypeRequest + */ +class GetSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetSessionEntityTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSipTrunkRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSipTrunkRequest.php new file mode 100644 index 000000000000..b77f8f426d74 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSipTrunkRequest.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.GetSipTrunkRequest + */ +class GetSipTrunkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. Please see + * {@see SipTrunksClient::sipTrunkName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetSipTrunkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the SIP trunk to delete. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetToolRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetToolRequest.php new file mode 100644 index 000000000000..766f3400303f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetToolRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.GetToolRequest + */ +class GetToolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The tool resource name to retrieve. Format: + * `projects//locations//tools/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The tool resource name to retrieve. Format: + * `projects//locations//tools/` + * Please see {@see ToolsClient::toolName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetToolRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The tool resource name to retrieve. Format: + * `projects//locations//tools/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The tool resource name to retrieve. Format: + * `projects//locations//tools/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The tool resource name to retrieve. Format: + * `projects//locations//tools/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php new file mode 100644 index 000000000000..b01dc517b5c4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.GetValidationResultRequest + */ +class GetValidationResultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent is associated with. + * Format: `projects/`. + * @type string $language_code + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php new file mode 100644 index 000000000000..15ec30575e04 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.GetVersionRequest + */ +class GetVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the version. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php new file mode 100644 index 000000000000..2bcc8c14f39a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php @@ -0,0 +1,217 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig + */ +class HumanAgentAssistantConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Pub/Sub topic on which to publish new agent assistant events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 2; + */ + protected $notification_config = null; + /** + * Configuration for agent assistance of human agent participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig human_agent_suggestion_config = 3; + */ + protected $human_agent_suggestion_config = null; + /** + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig end_user_suggestion_config = 4; + */ + protected $end_user_suggestion_config = null; + /** + * Configuration for message analysis. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig message_analysis_config = 5; + */ + protected $message_analysis_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\NotificationConfig $notification_config + * Pub/Sub topic on which to publish new agent assistant events. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $human_agent_suggestion_config + * Configuration for agent assistance of human agent participant. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $end_user_suggestion_config + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig $message_analysis_config + * Configuration for message analysis. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Pub/Sub topic on which to publish new agent assistant events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 2; + * @return \Google\Cloud\Dialogflow\V2\NotificationConfig|null + */ + public function getNotificationConfig() + { + return $this->notification_config; + } + + public function hasNotificationConfig() + { + return isset($this->notification_config); + } + + public function clearNotificationConfig() + { + unset($this->notification_config); + } + + /** + * Pub/Sub topic on which to publish new agent assistant events. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig notification_config = 2; + * @param \Google\Cloud\Dialogflow\V2\NotificationConfig $var + * @return $this + */ + public function setNotificationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\NotificationConfig::class); + $this->notification_config = $var; + + return $this; + } + + /** + * Configuration for agent assistance of human agent participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig human_agent_suggestion_config = 3; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig|null + */ + public function getHumanAgentSuggestionConfig() + { + return $this->human_agent_suggestion_config; + } + + public function hasHumanAgentSuggestionConfig() + { + return isset($this->human_agent_suggestion_config); + } + + public function clearHumanAgentSuggestionConfig() + { + unset($this->human_agent_suggestion_config); + } + + /** + * Configuration for agent assistance of human agent participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig human_agent_suggestion_config = 3; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $var + * @return $this + */ + public function setHumanAgentSuggestionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig::class); + $this->human_agent_suggestion_config = $var; + + return $this; + } + + /** + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig end_user_suggestion_config = 4; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig|null + */ + public function getEndUserSuggestionConfig() + { + return $this->end_user_suggestion_config; + } + + public function hasEndUserSuggestionConfig() + { + return isset($this->end_user_suggestion_config); + } + + public function clearEndUserSuggestionConfig() + { + unset($this->end_user_suggestion_config); + } + + /** + * Configuration for agent assistance of end user participant. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig end_user_suggestion_config = 4; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig $var + * @return $this + */ + public function setEndUserSuggestionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionConfig::class); + $this->end_user_suggestion_config = $var; + + return $this; + } + + /** + * Configuration for message analysis. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig message_analysis_config = 5; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig|null + */ + public function getMessageAnalysisConfig() + { + return $this->message_analysis_config; + } + + public function hasMessageAnalysisConfig() + { + return isset($this->message_analysis_config); + } + + public function clearMessageAnalysisConfig() + { + unset($this->message_analysis_config); + } + + /** + * Configuration for message analysis. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig message_analysis_config = 5; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig $var + * @return $this + */ + public function setMessageAnalysisConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\MessageAnalysisConfig::class); + $this->message_analysis_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php new file mode 100644 index 000000000000..94f9824a0884 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php @@ -0,0 +1,135 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + */ +class ConversationModelConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Conversation model resource name. Format: `projects//conversationModels/`. + * + * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { + */ + protected $model = ''; + /** + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * - Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * - Summarization baseline model: + * - 1.0 + * + * Generated from protobuf field string baseline_model_version = 8; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Conversation model resource name. Format: `projects//conversationModels/`. + * @type string $baseline_model_version + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * - Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * - Summarization baseline model: + * - 1.0 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Conversation model resource name. Format: `projects//conversationModels/`. + * + * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Conversation model resource name. Format: `projects//conversationModels/`. + * + * Generated from protobuf field string model = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * - Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * - Summarization baseline model: + * - 1.0 + * + * Generated from protobuf field string baseline_model_version = 8; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * Version of current baseline model. It will be ignored if + * [model][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.model] + * is set. Valid versions are: + * - Article Suggestion baseline model: + * - 0.9 + * - 1.0 (default) + * - Summarization baseline model: + * - 1.0 + * + * Generated from protobuf field string baseline_model_version = 8; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php new file mode 100644 index 000000000000..05d8640f1106 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig + */ +class ConversationProcessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * + * Generated from protobuf field int32 recent_sentences_count = 2; + */ + protected $recent_sentences_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $recent_sentences_count + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * + * Generated from protobuf field int32 recent_sentences_count = 2; + * @return int + */ + public function getRecentSentencesCount() + { + return $this->recent_sentences_count; + } + + /** + * Number of recent non-small-talk sentences to use as context for article + * and FAQ suggestion + * + * Generated from protobuf field int32 recent_sentences_count = 2; + * @param int $var + * @return $this + */ + public function setRecentSentencesCount($var) + { + GPBUtil::checkInt32($var); + $this->recent_sentences_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php new file mode 100644 index 000000000000..4cd9967a6a29 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php @@ -0,0 +1,307 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + */ +class MessageAnalysisConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field bool enable_entity_extraction = 2; + */ + protected $enable_entity_extraction = false; + /** + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis = 3; + */ + protected $enable_sentiment_analysis = false; + /** + * Optional. Enables sentiment analysis for audio input and conversation + * messages. If unspecified, defaults to false. If this flag is set to true, + * other 'enable_sentiment_analysis' fields will be ignored. + * Sentiment analysis inspects user input and identifies the prevailing + * subjective opinion, especially to determine a user's attitude as + * positive, negative, or neutral. + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis_v3 = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_sentiment_analysis_v3 = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_entity_extraction + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * @type bool $enable_sentiment_analysis + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * @type bool $enable_sentiment_analysis_v3 + * Optional. Enables sentiment analysis for audio input and conversation + * messages. If unspecified, defaults to false. If this flag is set to true, + * other 'enable_sentiment_analysis' fields will be ignored. + * Sentiment analysis inspects user input and identifies the prevailing + * subjective opinion, especially to determine a user's attitude as + * positive, negative, or neutral. + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field bool enable_entity_extraction = 2; + * @return bool + */ + public function getEnableEntityExtraction() + { + return $this->enable_entity_extraction; + } + + /** + * Enable entity extraction in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. + * Currently, this feature is not general available, please contact Google + * to get access. + * + * Generated from protobuf field bool enable_entity_extraction = 2; + * @param bool $var + * @return $this + */ + public function setEnableEntityExtraction($var) + { + GPBUtil::checkBool($var); + $this->enable_entity_extraction = $var; + + return $this; + } + + /** + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis = 3; + * @return bool + */ + public function getEnableSentimentAnalysis() + { + return $this->enable_sentiment_analysis; + } + + /** + * Enable sentiment analysis in conversation messages on [agent assist + * stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + * If unspecified, defaults to false. Sentiment analysis inspects user input + * and identifies the prevailing subjective opinion, especially to determine + * a user's attitude as positive, negative, or neutral: + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis = 3; + * @param bool $var + * @return $this + */ + public function setEnableSentimentAnalysis($var) + { + GPBUtil::checkBool($var); + $this->enable_sentiment_analysis = $var; + + return $this; + } + + /** + * Optional. Enables sentiment analysis for audio input and conversation + * messages. If unspecified, defaults to false. If this flag is set to true, + * other 'enable_sentiment_analysis' fields will be ignored. + * Sentiment analysis inspects user input and identifies the prevailing + * subjective opinion, especially to determine a user's attitude as + * positive, negative, or neutral. + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis_v3 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableSentimentAnalysisV3() + { + return $this->enable_sentiment_analysis_v3; + } + + /** + * Optional. Enables sentiment analysis for audio input and conversation + * messages. If unspecified, defaults to false. If this flag is set to true, + * other 'enable_sentiment_analysis' fields will be ignored. + * Sentiment analysis inspects user input and identifies the prevailing + * subjective opinion, especially to determine a user's attitude as + * positive, negative, or neutral. + * https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + * For + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * method, result will be in + * [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + * For + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * method, result will be in + * [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + * For + * [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + * method, result will be in + * [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + * If Pub/Sub notification is configured, result will be in + * [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + * + * Generated from protobuf field bool enable_sentiment_analysis_v3 = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableSentimentAnalysisV3($var) + { + GPBUtil::checkBool($var); + $this->enable_sentiment_analysis_v3 = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php new file mode 100644 index 000000000000..79e7bf5179de --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php @@ -0,0 +1,363 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + */ +class SuggestionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + */ + private $feature_configs; + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + */ + protected $group_suggestion_responses = false; + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $generators; + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_high_latency_features_sync_delivery = false; + /** + * Optional. Enable skipping event based suggestion if the suggestion is + * empty. + * For example, with this field disabled, Knowledge Assist feature sends + * a Pub/Sub message when there are no suggestions. Enabling this field + * will change the behavior to skip the Pub/Sub message in this situation. + * + * Generated from protobuf field bool skip_empty_event_based_suggestion = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip_empty_event_based_suggestion = false; + /** + * Optional. If true, + * use unredacted transcript data (Supported features: AI_COACH) and + * use unredacted ingested context (Supported features: All Agent Assist + * features) + * + * Generated from protobuf field bool use_unredacted_conversation_data = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $use_unredacted_conversation_data = false; + /** + * Optional. If true, enable asynchronous execution of tools. + * + * Generated from protobuf field bool enable_async_tool_call = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_async_tool_call = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig[] $feature_configs + * Configuration of different suggestion features. One feature can have only + * one config. + * @type bool $group_suggestion_responses + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * @type string[] $generators + * Optional. List of various generator resource names used in the + * conversation profile. + * @type bool $disable_high_latency_features_sync_delivery + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * @type bool $skip_empty_event_based_suggestion + * Optional. Enable skipping event based suggestion if the suggestion is + * empty. + * For example, with this field disabled, Knowledge Assist feature sends + * a Pub/Sub message when there are no suggestions. Enabling this field + * will change the behavior to skip the Pub/Sub message in this situation. + * @type bool $use_unredacted_conversation_data + * Optional. If true, + * use unredacted transcript data (Supported features: AI_COACH) and + * use unredacted ingested context (Supported features: All Agent Assist + * features) + * @type bool $enable_async_tool_call + * Optional. If true, enable asynchronous execution of tools. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig> + */ + public function getFeatureConfigs() + { + return $this->feature_configs; + } + + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig[] $var + * @return $this + */ + public function setFeatureConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig::class); + $this->feature_configs = $arr; + + return $this; + } + + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + * @return bool + */ + public function getGroupSuggestionResponses() + { + return $this->group_suggestion_responses; + } + + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + * @param bool $var + * @return $this + */ + public function setGroupSuggestionResponses($var) + { + GPBUtil::checkBool($var); + $this->group_suggestion_responses = $var; + + return $this; + } + + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getGenerators() + { + return $this->generators; + } + + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setGenerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->generators = $arr; + + return $this; + } + + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableHighLatencyFeaturesSyncDelivery() + { + return $this->disable_high_latency_features_sync_delivery; + } + + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableHighLatencyFeaturesSyncDelivery($var) + { + GPBUtil::checkBool($var); + $this->disable_high_latency_features_sync_delivery = $var; + + return $this; + } + + /** + * Optional. Enable skipping event based suggestion if the suggestion is + * empty. + * For example, with this field disabled, Knowledge Assist feature sends + * a Pub/Sub message when there are no suggestions. Enabling this field + * will change the behavior to skip the Pub/Sub message in this situation. + * + * Generated from protobuf field bool skip_empty_event_based_suggestion = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSkipEmptyEventBasedSuggestion() + { + return $this->skip_empty_event_based_suggestion; + } + + /** + * Optional. Enable skipping event based suggestion if the suggestion is + * empty. + * For example, with this field disabled, Knowledge Assist feature sends + * a Pub/Sub message when there are no suggestions. Enabling this field + * will change the behavior to skip the Pub/Sub message in this situation. + * + * Generated from protobuf field bool skip_empty_event_based_suggestion = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSkipEmptyEventBasedSuggestion($var) + { + GPBUtil::checkBool($var); + $this->skip_empty_event_based_suggestion = $var; + + return $this; + } + + /** + * Optional. If true, + * use unredacted transcript data (Supported features: AI_COACH) and + * use unredacted ingested context (Supported features: All Agent Assist + * features) + * + * Generated from protobuf field bool use_unredacted_conversation_data = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseUnredactedConversationData() + { + return $this->use_unredacted_conversation_data; + } + + /** + * Optional. If true, + * use unredacted transcript data (Supported features: AI_COACH) and + * use unredacted ingested context (Supported features: All Agent Assist + * features) + * + * Generated from protobuf field bool use_unredacted_conversation_data = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseUnredactedConversationData($var) + { + GPBUtil::checkBool($var); + $this->use_unredacted_conversation_data = $var; + + return $this; + } + + /** + * Optional. If true, enable asynchronous execution of tools. + * + * Generated from protobuf field bool enable_async_tool_call = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAsyncToolCall() + { + return $this->enable_async_tool_call; + } + + /** + * Optional. If true, enable asynchronous execution of tools. + * + * Generated from protobuf field bool enable_async_tool_call = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAsyncToolCall($var) + { + GPBUtil::checkBool($var); + $this->enable_async_tool_call = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php new file mode 100644 index 000000000000..fa8540bbdc0e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php @@ -0,0 +1,665 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + */ +class SuggestionFeatureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + */ + protected $suggestion_feature = null; + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + */ + protected $enable_event_based_suggestion = false; + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_agent_query_logging = false; + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_query_suggestion_when_no_answer = false; + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_conversation_augmented_query = false; + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_query_suggestion_only = false; + /** + * Optional. Enable returning detailed reasons for suggestion results. + * For example, with this field disabled, Knowledge Search feature returns + * NotFound error when no answer is found for the input query. Enabling this + * field will change the behavior to return an OK response with + * detailed information indicating the lack of results. + * Supported features: KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_response_debug_info = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_response_debug_info = false; + /** + * Optional. Settings for Responsible AI checks. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings rai_settings = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rai_settings = null; + /** + * Optional. The trigger event for suggestion. + * If unspecified, it will be `CUSTOMER_MESSAGE`. + * Supported features: KNOWLEDGE_ASSIST + * For KNOWLEDGE_ASSIST, these four trigger events are supported: + * 1. TRIGGER_EVENT_UNSPECIFIED + * 2. END_OF_UTTERANCE + * 3. CUSTOMER_MESSAGE + * 4. AGENT_MESSAGE + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent suggestion_trigger_event = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $suggestion_trigger_event = 0; + /** + * Optional. If true, disable appending available search context to the + * search query. Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_query_search_context = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_query_search_context = false; + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + */ + protected $suggestion_trigger_settings = null; + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + */ + protected $query_config = null; + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + */ + protected $conversation_model_config = null; + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + */ + protected $conversation_process_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SuggestionFeature $suggestion_feature + * The suggestion feature. + * @type bool $enable_event_based_suggestion + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * @type bool $disable_agent_query_logging + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * @type bool $enable_query_suggestion_when_no_answer + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * @type bool $enable_conversation_augmented_query + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * @type bool $enable_query_suggestion_only + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * @type bool $enable_response_debug_info + * Optional. Enable returning detailed reasons for suggestion results. + * For example, with this field disabled, Knowledge Search feature returns + * NotFound error when no answer is found for the input query. Enabling this + * field will change the behavior to return an OK response with + * detailed information indicating the lack of results. + * Supported features: KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST + * @type \Google\Cloud\Dialogflow\V2\RaiSettings $rai_settings + * Optional. Settings for Responsible AI checks. + * Supported features: KNOWLEDGE_ASSIST + * @type int $suggestion_trigger_event + * Optional. The trigger event for suggestion. + * If unspecified, it will be `CUSTOMER_MESSAGE`. + * Supported features: KNOWLEDGE_ASSIST + * For KNOWLEDGE_ASSIST, these four trigger events are supported: + * 1. TRIGGER_EVENT_UNSPECIFIED + * 2. END_OF_UTTERANCE + * 3. CUSTOMER_MESSAGE + * 4. AGENT_MESSAGE + * @type bool $disable_query_search_context + * Optional. If true, disable appending available search context to the + * search query. Supported features: KNOWLEDGE_ASSIST + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings $suggestion_trigger_settings + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig $query_config + * Configs of query. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig $conversation_model_config + * Configs of custom conversation model. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig $conversation_process_config + * Configs for processing conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + * @return \Google\Cloud\Dialogflow\V2\SuggestionFeature|null + */ + public function getSuggestionFeature() + { + return $this->suggestion_feature; + } + + public function hasSuggestionFeature() + { + return isset($this->suggestion_feature); + } + + public function clearSuggestionFeature() + { + unset($this->suggestion_feature); + } + + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + * @param \Google\Cloud\Dialogflow\V2\SuggestionFeature $var + * @return $this + */ + public function setSuggestionFeature($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature::class); + $this->suggestion_feature = $var; + + return $this; + } + + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + * @return bool + */ + public function getEnableEventBasedSuggestion() + { + return $this->enable_event_based_suggestion; + } + + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + * @param bool $var + * @return $this + */ + public function setEnableEventBasedSuggestion($var) + { + GPBUtil::checkBool($var); + $this->enable_event_based_suggestion = $var; + + return $this; + } + + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableAgentQueryLogging() + { + return $this->disable_agent_query_logging; + } + + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableAgentQueryLogging($var) + { + GPBUtil::checkBool($var); + $this->disable_agent_query_logging = $var; + + return $this; + } + + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableQuerySuggestionWhenNoAnswer() + { + return $this->enable_query_suggestion_when_no_answer; + } + + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableQuerySuggestionWhenNoAnswer($var) + { + GPBUtil::checkBool($var); + $this->enable_query_suggestion_when_no_answer = $var; + + return $this; + } + + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableConversationAugmentedQuery() + { + return $this->enable_conversation_augmented_query; + } + + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableConversationAugmentedQuery($var) + { + GPBUtil::checkBool($var); + $this->enable_conversation_augmented_query = $var; + + return $this; + } + + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableQuerySuggestionOnly() + { + return $this->enable_query_suggestion_only; + } + + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableQuerySuggestionOnly($var) + { + GPBUtil::checkBool($var); + $this->enable_query_suggestion_only = $var; + + return $this; + } + + /** + * Optional. Enable returning detailed reasons for suggestion results. + * For example, with this field disabled, Knowledge Search feature returns + * NotFound error when no answer is found for the input query. Enabling this + * field will change the behavior to return an OK response with + * detailed information indicating the lack of results. + * Supported features: KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_response_debug_info = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableResponseDebugInfo() + { + return $this->enable_response_debug_info; + } + + /** + * Optional. Enable returning detailed reasons for suggestion results. + * For example, with this field disabled, Knowledge Search feature returns + * NotFound error when no answer is found for the input query. Enabling this + * field will change the behavior to return an OK response with + * detailed information indicating the lack of results. + * Supported features: KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_response_debug_info = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableResponseDebugInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_response_debug_info = $var; + + return $this; + } + + /** + * Optional. Settings for Responsible AI checks. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings rai_settings = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\RaiSettings|null + */ + public function getRaiSettings() + { + return $this->rai_settings; + } + + public function hasRaiSettings() + { + return isset($this->rai_settings); + } + + public function clearRaiSettings() + { + unset($this->rai_settings); + } + + /** + * Optional. Settings for Responsible AI checks. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings rai_settings = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\RaiSettings $var + * @return $this + */ + public function setRaiSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\RaiSettings::class); + $this->rai_settings = $var; + + return $this; + } + + /** + * Optional. The trigger event for suggestion. + * If unspecified, it will be `CUSTOMER_MESSAGE`. + * Supported features: KNOWLEDGE_ASSIST + * For KNOWLEDGE_ASSIST, these four trigger events are supported: + * 1. TRIGGER_EVENT_UNSPECIFIED + * 2. END_OF_UTTERANCE + * 3. CUSTOMER_MESSAGE + * 4. AGENT_MESSAGE + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent suggestion_trigger_event = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSuggestionTriggerEvent() + { + return $this->suggestion_trigger_event; + } + + /** + * Optional. The trigger event for suggestion. + * If unspecified, it will be `CUSTOMER_MESSAGE`. + * Supported features: KNOWLEDGE_ASSIST + * For KNOWLEDGE_ASSIST, these four trigger events are supported: + * 1. TRIGGER_EVENT_UNSPECIFIED + * 2. END_OF_UTTERANCE + * 3. CUSTOMER_MESSAGE + * 4. AGENT_MESSAGE + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent suggestion_trigger_event = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSuggestionTriggerEvent($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->suggestion_trigger_event = $var; + + return $this; + } + + /** + * Optional. If true, disable appending available search context to the + * search query. Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_query_search_context = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableQuerySearchContext() + { + return $this->disable_query_search_context; + } + + /** + * Optional. If true, disable appending available search context to the + * search query. Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_query_search_context = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableQuerySearchContext($var) + { + GPBUtil::checkBool($var); + $this->disable_query_search_context = $var; + + return $this; + } + + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings|null + */ + public function getSuggestionTriggerSettings() + { + return $this->suggestion_trigger_settings; + } + + public function hasSuggestionTriggerSettings() + { + return isset($this->suggestion_trigger_settings); + } + + public function clearSuggestionTriggerSettings() + { + unset($this->suggestion_trigger_settings); + } + + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings $var + * @return $this + */ + public function setSuggestionTriggerSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings::class); + $this->suggestion_trigger_settings = $var; + + return $this; + } + + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig|null + */ + public function getQueryConfig() + { + return $this->query_config; + } + + public function hasQueryConfig() + { + return isset($this->query_config); + } + + public function clearQueryConfig() + { + unset($this->query_config); + } + + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig $var + * @return $this + */ + public function setQueryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig::class); + $this->query_config = $var; + + return $this; + } + + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig|null + */ + public function getConversationModelConfig() + { + return $this->conversation_model_config; + } + + public function hasConversationModelConfig() + { + return isset($this->conversation_model_config); + } + + public function clearConversationModelConfig() + { + unset($this->conversation_model_config); + } + + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig $var + * @return $this + */ + public function setConversationModelConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig::class); + $this->conversation_model_config = $var; + + return $this; + } + + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig|null + */ + public function getConversationProcessConfig() + { + return $this->conversation_process_config; + } + + public function hasConversationProcessConfig() + { + return isset($this->conversation_process_config); + } + + public function clearConversationProcessConfig() + { + unset($this->conversation_process_config); + } + + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig $var + * @return $this + */ + public function setConversationProcessConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig::class); + $this->conversation_process_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php new file mode 100644 index 000000000000..1d46fc48edfb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php @@ -0,0 +1,409 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + */ +class SuggestionQueryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + */ + protected $max_results = 0; + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + */ + protected $confidence_threshold = 0.0; + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + */ + protected $context_filter_settings = null; + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sections = null; + /** + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * + * Generated from protobuf field int32 context_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + protected $query_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $knowledge_base_query_source + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $document_query_source + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $dialogflow_query_source + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * @type int $max_results + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * @type float $confidence_threshold + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $context_filter_settings + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $sections + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * @type int $context_size + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource|null + */ + public function getKnowledgeBaseQuerySource() + { + return $this->readOneof(1); + } + + public function hasKnowledgeBaseQuerySource() + { + return $this->hasOneof(1); + } + + /** + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $var + * @return $this + */ + public function setKnowledgeBaseQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource|null + */ + public function getDocumentQuerySource() + { + return $this->readOneof(2); + } + + public function hasDocumentQuerySource() + { + return $this->hasOneof(2); + } + + /** + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $var + * @return $this + */ + public function setDocumentQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource|null + */ + public function getDialogflowQuerySource() + { + return $this->readOneof(3); + } + + public function hasDialogflowQuerySource() + { + return $this->hasOneof(3); + } + + /** + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $var + * @return $this + */ + public function setDialogflowQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + * @return int + */ + public function getMaxResults() + { + return $this->max_results; + } + + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + * @param int $var + * @return $this + */ + public function setMaxResults($var) + { + GPBUtil::checkInt32($var); + $this->max_results = $var; + + return $this; + } + + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings|null + */ + public function getContextFilterSettings() + { + return $this->context_filter_settings; + } + + public function hasContextFilterSettings() + { + return isset($this->context_filter_settings); + } + + public function clearContextFilterSettings() + { + unset($this->context_filter_settings); + } + + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $var + * @return $this + */ + public function setContextFilterSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings::class); + $this->context_filter_settings = $var; + + return $this; + } + + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections|null + */ + public function getSections() + { + return $this->sections; + } + + public function hasSections() + { + return isset($this->sections); + } + + public function clearSections() + { + unset($this->sections); + } + + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $var + * @return $this + */ + public function setSections($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections::class); + $this->sections = $var; + + return $this; + } + + /** + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * + * Generated from protobuf field int32 context_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. The number of recent messages to include in the context. + * Supported features: KNOWLEDGE_ASSIST. + * + * Generated from protobuf field int32 context_size = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * @return string + */ + public function getQuerySource() + { + return $this->whichOneof("query_source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php new file mode 100644 index 000000000000..c91bb4373e4a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php @@ -0,0 +1,140 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + */ +class ContextFilterSettings extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * + * Generated from protobuf field bool drop_handoff_messages = 1; + */ + protected $drop_handoff_messages = false; + /** + * If set to true, all messages from virtual agent are dropped. + * + * Generated from protobuf field bool drop_virtual_agent_messages = 2; + */ + protected $drop_virtual_agent_messages = false; + /** + * If set to true, all messages from ivr stage are dropped. + * + * Generated from protobuf field bool drop_ivr_messages = 3; + */ + protected $drop_ivr_messages = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $drop_handoff_messages + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * @type bool $drop_virtual_agent_messages + * If set to true, all messages from virtual agent are dropped. + * @type bool $drop_ivr_messages + * If set to true, all messages from ivr stage are dropped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * + * Generated from protobuf field bool drop_handoff_messages = 1; + * @return bool + */ + public function getDropHandoffMessages() + { + return $this->drop_handoff_messages; + } + + /** + * If set to true, the last message from virtual agent (hand off message) + * and the message before it (trigger message of hand off) are dropped. + * + * Generated from protobuf field bool drop_handoff_messages = 1; + * @param bool $var + * @return $this + */ + public function setDropHandoffMessages($var) + { + GPBUtil::checkBool($var); + $this->drop_handoff_messages = $var; + + return $this; + } + + /** + * If set to true, all messages from virtual agent are dropped. + * + * Generated from protobuf field bool drop_virtual_agent_messages = 2; + * @return bool + */ + public function getDropVirtualAgentMessages() + { + return $this->drop_virtual_agent_messages; + } + + /** + * If set to true, all messages from virtual agent are dropped. + * + * Generated from protobuf field bool drop_virtual_agent_messages = 2; + * @param bool $var + * @return $this + */ + public function setDropVirtualAgentMessages($var) + { + GPBUtil::checkBool($var); + $this->drop_virtual_agent_messages = $var; + + return $this; + } + + /** + * If set to true, all messages from ivr stage are dropped. + * + * Generated from protobuf field bool drop_ivr_messages = 3; + * @return bool + */ + public function getDropIvrMessages() + { + return $this->drop_ivr_messages; + } + + /** + * If set to true, all messages from ivr stage are dropped. + * + * Generated from protobuf field bool drop_ivr_messages = 3; + * @param bool $var + * @return $this + */ + public function setDropIvrMessages($var) + { + GPBUtil::checkBool($var); + $this->drop_ivr_messages = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php new file mode 100644 index 000000000000..370ad96715d1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php @@ -0,0 +1,124 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + */ +class DialogflowQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $agent = ''; + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $human_agent_side_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $human_agent_side_config + * Optional. The Dialogflow assist configuration for human agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig|null + */ + public function getHumanAgentSideConfig() + { + return $this->human_agent_side_config; + } + + public function hasHumanAgentSideConfig() + { + return isset($this->human_agent_side_config); + } + + public function clearHumanAgentSideConfig() + { + unset($this->human_agent_side_config); + } + + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $var + * @return $this + */ + public function setHumanAgentSideConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig::class); + $this->human_agent_side_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php new file mode 100644 index 000000000000..78108be5817f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php @@ -0,0 +1,76 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig + */ +class HumanAgentSideConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $agent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php new file mode 100644 index 000000000000..0bb0474ce3e0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php @@ -0,0 +1,80 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + */ +class DocumentQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * + * Generated from protobuf field repeated string documents = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $documents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $documents + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * + * Generated from protobuf field repeated string documents = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * Required. Knowledge documents to query from. Format: + * `projects//locations//knowledgeBases//documents/`. + * Currently, at most 5 documents are supported. + * + * Generated from protobuf field repeated string documents = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php new file mode 100644 index 000000000000..0e9ea7642159 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php @@ -0,0 +1,80 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + */ +class KnowledgeBaseQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * + * Generated from protobuf field repeated string knowledge_bases = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $knowledge_bases; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $knowledge_bases + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * + * Generated from protobuf field repeated string knowledge_bases = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getKnowledgeBases() + { + return $this->knowledge_bases; + } + + /** + * Required. Knowledge bases to query. Format: + * `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + * bases are supported. + * + * Generated from protobuf field repeated string knowledge_bases = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setKnowledgeBases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->knowledge_bases = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php new file mode 100644 index 000000000000..4a4c12019dc5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections + */ +class Sections extends \Google\Protobuf\Internal\Message +{ + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + */ + private $section_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[] $section_types + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + * @return RepeatedField + */ + public function getSectionTypes() + { + return $this->section_types; + } + + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + * @param int[] $var + * @return $this + */ + public function setSectionTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections\SectionType::class); + $this->section_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php new file mode 100644 index 000000000000..dfcfe99971d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php @@ -0,0 +1,100 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType + */ +class SectionType +{ + /** + * Undefined section type, does not return anything. + * + * Generated from protobuf enum SECTION_TYPE_UNSPECIFIED = 0; + */ + const SECTION_TYPE_UNSPECIFIED = 0; + /** + * What the customer needs help with or has question about. + * Section name: "situation". + * + * Generated from protobuf enum SITUATION = 1; + */ + const SITUATION = 1; + /** + * What the agent does to help the customer. + * Section name: "action". + * + * Generated from protobuf enum ACTION = 2; + */ + const ACTION = 2; + /** + * Result of the customer service. A single word describing the result + * of the conversation. + * Section name: "resolution". + * + * Generated from protobuf enum RESOLUTION = 3; + */ + const RESOLUTION = 3; + /** + * Reason for cancellation if the customer requests for a cancellation. + * "N/A" otherwise. + * Section name: "reason_for_cancellation". + * + * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; + */ + const REASON_FOR_CANCELLATION = 4; + /** + * "Unsatisfied" or "Satisfied" depending on the customer's feelings at + * the end of the conversation. + * Section name: "customer_satisfaction". + * + * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; + */ + const CUSTOMER_SATISFACTION = 5; + /** + * Key entities extracted from the conversation, such as ticket number, + * order number, dollar amount, etc. + * Section names are prefixed by "entities/". + * + * Generated from protobuf enum ENTITIES = 6; + */ + const ENTITIES = 6; + + private static $valueToName = [ + self::SECTION_TYPE_UNSPECIFIED => 'SECTION_TYPE_UNSPECIFIED', + self::SITUATION => 'SITUATION', + self::ACTION => 'ACTION', + self::RESOLUTION => 'RESOLUTION', + self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', + self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', + self::ENTITIES => 'ENTITIES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php new file mode 100644 index 000000000000..0ceeb694dd71 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + */ +class SuggestionTriggerSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Do not trigger if last utterance is small talk. + * + * Generated from protobuf field bool no_smalltalk = 1; + */ + protected $no_smalltalk = false; + /** + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * + * Generated from protobuf field bool only_end_user = 2; + */ + protected $only_end_user = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $no_smalltalk + * Do not trigger if last utterance is small talk. + * @type bool $only_end_user + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Do not trigger if last utterance is small talk. + * + * Generated from protobuf field bool no_smalltalk = 1; + * @return bool + */ + public function getNoSmalltalk() + { + return $this->no_smalltalk; + } + + /** + * Do not trigger if last utterance is small talk. + * + * Generated from protobuf field bool no_smalltalk = 1; + * @param bool $var + * @return $this + */ + public function setNoSmalltalk($var) + { + GPBUtil::checkBool($var); + $this->no_smalltalk = $var; + + return $this; + } + + /** + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * + * Generated from protobuf field bool only_end_user = 2; + * @return bool + */ + public function getOnlyEndUser() + { + return $this->only_end_user; + } + + /** + * Only trigger suggestion if participant role of last utterance is + * END_USER. + * + * Generated from protobuf field bool only_end_user = 2; + * @param bool $var + * @return $this + */ + public function setOnlyEndUser($var) + { + GPBUtil::checkBool($var); + $this->only_end_user = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php new file mode 100644 index 000000000000..beba77e6aa00 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php @@ -0,0 +1,148 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantEvent + */ +class HumanAgentAssistantEvent extends \Google\Protobuf\Internal\Message +{ + /** + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + */ + protected $conversation = ''; + /** + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * + * Generated from protobuf field string participant = 3; + */ + protected $participant = ''; + /** + * The suggestion results payload that this notification refers to. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult suggestion_results = 5; + */ + private $suggestion_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * @type string $participant + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * @type \Google\Cloud\Dialogflow\V2\SuggestionResult[] $suggestion_results + * The suggestion results payload that this notification refers to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\HumanAgentAssistantEvent::initOnce(); + parent::__construct($data); + } + + /** + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * The conversation this notification refers to. + * Format: `projects//conversations/`. + * + * Generated from protobuf field string conversation = 1; + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * + * Generated from protobuf field string participant = 3; + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * The participant that the suggestion is compiled for. + * Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + * + * Generated from protobuf field string participant = 3; + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * The suggestion results payload that this notification refers to. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult suggestion_results = 5; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SuggestionResult> + */ + public function getSuggestionResults() + { + return $this->suggestion_results; + } + + /** + * The suggestion results payload that this notification refers to. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult suggestion_results = 5; + * @param \Google\Cloud\Dialogflow\V2\SuggestionResult[] $var + * @return $this + */ + public function setSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->suggestion_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php new file mode 100644 index 000000000000..484b4a981d6f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.HumanAgentHandoffConfig + */ +class HumanAgentHandoffConfig extends \Google\Protobuf\Internal\Message +{ + protected $agent_service; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig $live_person_config + * Uses [LivePerson](https://www.liveperson.com). + * @type \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig $salesforce_live_agent_config + * Uses Salesforce Live Agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Uses [LivePerson](https://www.liveperson.com). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig live_person_config = 1; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig|null + */ + public function getLivePersonConfig() + { + return $this->readOneof(1); + } + + public function hasLivePersonConfig() + { + return $this->hasOneof(1); + } + + /** + * Uses [LivePerson](https://www.liveperson.com). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig live_person_config = 1; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig $var + * @return $this + */ + public function setLivePersonConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\LivePersonConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Uses Salesforce Live Agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig salesforce_live_agent_config = 2; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig|null + */ + public function getSalesforceLiveAgentConfig() + { + return $this->readOneof(2); + } + + public function hasSalesforceLiveAgentConfig() + { + return $this->hasOneof(2); + } + + /** + * Uses Salesforce Live Agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig salesforce_live_agent_config = 2; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig $var + * @return $this + */ + public function setSalesforceLiveAgentConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig\SalesforceLiveAgentConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgentService() + { + return $this->whichOneof("agent_service"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php new file mode 100644 index 000000000000..7e7ced831d99 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig + */ +class LivePersonConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * + * Generated from protobuf field string account_number = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $account_number = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $account_number + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * + * Generated from protobuf field string account_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccountNumber() + { + return $this->account_number; + } + + /** + * Required. Account number of the LivePerson account to connect. This is + * the account number you input at the login page. + * + * Generated from protobuf field string account_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccountNumber($var) + { + GPBUtil::checkString($var, True); + $this->account_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php new file mode 100644 index 000000000000..ffd46ad9a93e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php @@ -0,0 +1,181 @@ +google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + */ +class SalesforceLiveAgentConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization ID of the Salesforce account. + * + * Generated from protobuf field string organization_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization_id = ''; + /** + * Required. Live Agent deployment ID. + * + * Generated from protobuf field string deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $deployment_id = ''; + /** + * Required. Live Agent chat button ID. + * + * Generated from protobuf field string button_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $button_id = ''; + /** + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * + * Generated from protobuf field string endpoint_domain = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $endpoint_domain = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization_id + * Required. The organization ID of the Salesforce account. + * @type string $deployment_id + * Required. Live Agent deployment ID. + * @type string $button_id + * Required. Live Agent chat button ID. + * @type string $endpoint_domain + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization ID of the Salesforce account. + * + * Generated from protobuf field string organization_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOrganizationId() + { + return $this->organization_id; + } + + /** + * Required. The organization ID of the Salesforce account. + * + * Generated from protobuf field string organization_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOrganizationId($var) + { + GPBUtil::checkString($var, True); + $this->organization_id = $var; + + return $this; + } + + /** + * Required. Live Agent deployment ID. + * + * Generated from protobuf field string deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDeploymentId() + { + return $this->deployment_id; + } + + /** + * Required. Live Agent deployment ID. + * + * Generated from protobuf field string deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDeploymentId($var) + { + GPBUtil::checkString($var, True); + $this->deployment_id = $var; + + return $this; + } + + /** + * Required. Live Agent chat button ID. + * + * Generated from protobuf field string button_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getButtonId() + { + return $this->button_id; + } + + /** + * Required. Live Agent chat button ID. + * + * Generated from protobuf field string button_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setButtonId($var) + { + GPBUtil::checkString($var, True); + $this->button_id = $var; + + return $this; + } + + /** + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * + * Generated from protobuf field string endpoint_domain = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEndpointDomain() + { + return $this->endpoint_domain; + } + + /** + * Required. Domain of the Live Agent endpoint for this agent. You can find + * the endpoint URL in the `Live Agent settings` page. For example if URL + * has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + * you should fill in d.la4-c2-phx.salesforceliveagent.com. + * + * Generated from protobuf field string endpoint_domain = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEndpointDomain($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_domain = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php new file mode 100644 index 000000000000..4bc424afa049 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.ImportAgentRequest + */ +class ImportAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + protected $agent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * @type string $agent_uri + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @type string $agent_content + * Zip compressed raw byte content for agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to import is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @return string + */ + public function getAgentUri() + { + return $this->readOneof(2); + } + + public function hasAgentUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @return string + */ + public function getAgentContent() + { + return $this->readOneof(3); + } + + public function hasAgentContent() + { + return $this->hasOneof(3); + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @param string $var + * @return $this + */ + public function setAgentContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgent() + { + return $this->whichOneof("agent"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php new file mode 100644 index 000000000000..03db69545d09 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php @@ -0,0 +1,163 @@ +google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata + */ +class ImportConversationDataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + */ + protected $conversation_dataset = ''; + /** + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + */ + private $partial_failures; + /** + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_dataset + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * @type \Google\Rpc\Status[] $partial_failures + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkString($var, True); + $this->conversation_dataset = $var; + + return $this; + } + + /** + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @return RepeatedField<\Google\Rpc\Status> + */ + public function getPartialFailures() + { + return $this->partial_failures; + } + + /** + * Partial failures are failures that don't fail the whole long running + * operation, e.g. single files that couldn't be read. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @param \Google\Rpc\Status[] $var + * @return $this + */ + public function setPartialFailures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_failures = $arr; + + return $this; + } + + /** + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when import conversation data request was created. The time is + * measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php new file mode 100644 index 000000000000..5641c555d458 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.ImportConversationDataOperationResponse + */ +class ImportConversationDataOperationResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + */ + protected $conversation_dataset = ''; + /** + * Number of conversations imported successfully. + * + * Generated from protobuf field int32 import_count = 3; + */ + protected $import_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_dataset + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * @type int $import_count + * Number of conversations imported successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConversationDataset() + { + return $this->conversation_dataset; + } + + /** + * The resource name of the imported conversation dataset. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string conversation_dataset = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationDataset($var) + { + GPBUtil::checkString($var, True); + $this->conversation_dataset = $var; + + return $this; + } + + /** + * Number of conversations imported successfully. + * + * Generated from protobuf field int32 import_count = 3; + * @return int + */ + public function getImportCount() + { + return $this->import_count; + } + + /** + * Number of conversations imported successfully. + * + * Generated from protobuf field int32 import_count = 3; + * @param int $var + * @return $this + */ + public function setImportCount($var) + { + GPBUtil::checkInt32($var); + $this->import_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php new file mode 100644 index 000000000000..3220e70759f9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php @@ -0,0 +1,120 @@ +google.cloud.dialogflow.v2.ImportConversationDataRequest + */ +class ImportConversationDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Configuration describing where to import data from. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * @type \Google\Cloud\Dialogflow\V2\InputConfig $input_config + * Required. Configuration describing where to import data from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Configuration describing where to import data from. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. Configuration describing where to import data from. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputConfig::class); + $this->input_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php new file mode 100644 index 000000000000..0adb9155775a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.ImportDocumentTemplate + */ +class ImportDocumentTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The MIME type of the document. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mime_type = ''; + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $knowledge_types; + /** + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 3; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mime_type + * Required. The MIME type of the document. + * @type int[] $knowledge_types + * Required. The knowledge type of document content. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The MIME type of the document. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Required. The MIME type of the document. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getKnowledgeTypes() + { + return $this->knowledge_types; + } + + /** + * Required. The knowledge type of document content. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int[] $var + * @return $this + */ + public function setKnowledgeTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Document\KnowledgeType::class); + $this->knowledge_types = $arr; + + return $this; + } + + /** + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Metadata for the document. The metadata supports arbitrary + * key-value pairs. Suggested use cases include storing a document's title, + * an external URL distinct from the document's content_uri, etc. + * The max size of a `key` or a `value` of the metadata is 1024 bytes. + * + * Generated from protobuf field map metadata = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php new file mode 100644 index 000000000000..0e4ee35886db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php @@ -0,0 +1,212 @@ +google.cloud.dialogflow.v2.ImportDocumentsRequest + */ +class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Document template used for importing all the documents. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ImportDocumentTemplate document_template = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document_template = null; + /** + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4; + */ + protected $import_gcs_custom_metadata = false; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * @type \Google\Cloud\Dialogflow\V2\GcsSources $gcs_source + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * @type \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate $document_template + * Required. Document template used for importing all the documents. + * @type bool $import_gcs_custom_metadata + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\GcsSources|null + */ + public function getGcsSource() + { + return $this->readOneof(2); + } + + public function hasGcsSource() + { + return $this->hasOneof(2); + } + + /** + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\GcsSources $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsSources::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. Document template used for importing all the documents. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ImportDocumentTemplate document_template = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate|null + */ + public function getDocumentTemplate() + { + return $this->document_template; + } + + public function hasDocumentTemplate() + { + return isset($this->document_template); + } + + public function clearDocumentTemplate() + { + unset($this->document_template); + } + + /** + * Required. Document template used for importing all the documents. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ImportDocumentTemplate document_template = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate $var + * @return $this + */ + public function setDocumentTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ImportDocumentTemplate::class); + $this->document_template = $var; + + return $this; + } + + /** + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4; + * @return bool + */ + public function getImportGcsCustomMetadata() + { + return $this->import_gcs_custom_metadata; + } + + /** + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4; + * @param bool $var + * @return $this + */ + public function setImportGcsCustomMetadata($var) + { + GPBUtil::checkBool($var); + $this->import_gcs_custom_metadata = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php new file mode 100644 index 000000000000..962239263eca --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.ImportDocumentsResponse + */ +class ImportDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Includes details about skipped documents or any other warnings. + * + * Generated from protobuf field repeated .google.rpc.Status warnings = 1; + */ + private $warnings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status[] $warnings + * Includes details about skipped documents or any other warnings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Includes details about skipped documents or any other warnings. + * + * Generated from protobuf field repeated .google.rpc.Status warnings = 1; + * @return RepeatedField<\Google\Rpc\Status> + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * Includes details about skipped documents or any other warnings. + * + * Generated from protobuf field repeated .google.rpc.Status warnings = 1; + * @param \Google\Rpc\Status[] $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->warnings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php new file mode 100644 index 000000000000..318ac43d4f50 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php @@ -0,0 +1,277 @@ +google.cloud.dialogflow.v2.InferenceParameter + */ +class InferenceParameter extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_output_tokens = null; + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $temperature = null; + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $top_k = null; + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $top_p = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_output_tokens + * Optional. Maximum number of the output tokens for the generator. + * @type float $temperature + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * @type int $top_k + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * @type float $top_p + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxOutputTokens() + { + return isset($this->max_output_tokens) ? $this->max_output_tokens : 0; + } + + public function hasMaxOutputTokens() + { + return isset($this->max_output_tokens); + } + + public function clearMaxOutputTokens() + { + unset($this->max_output_tokens); + } + + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxOutputTokens($var) + { + GPBUtil::checkInt32($var); + $this->max_output_tokens = $var; + + return $this; + } + + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTemperature() + { + return isset($this->temperature) ? $this->temperature : 0.0; + } + + public function hasTemperature() + { + return isset($this->temperature); + } + + public function clearTemperature() + { + unset($this->temperature); + } + + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTemperature($var) + { + GPBUtil::checkDouble($var); + $this->temperature = $var; + + return $this; + } + + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTopK() + { + return isset($this->top_k) ? $this->top_k : 0; + } + + public function hasTopK() + { + return isset($this->top_k); + } + + public function clearTopK() + { + unset($this->top_k); + } + + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTopK($var) + { + GPBUtil::checkInt32($var); + $this->top_k = $var; + + return $this; + } + + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTopP() + { + return isset($this->top_p) ? $this->top_p : 0.0; + } + + public function hasTopP() + { + return isset($this->top_p); + } + + public function clearTopP() + { + unset($this->top_p); + } + + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTopP($var) + { + GPBUtil::checkDouble($var); + $this->top_p = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesRequest.php new file mode 100644 index 000000000000..6b8cbf7739c9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesRequest.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.IngestContextReferencesRequest + */ +class IngestContextReferencesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $context_references; + + /** + * @param string $conversation Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * @param array $contextReferences Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * @return \Google\Cloud\Dialogflow\V2\IngestContextReferencesRequest + * + * @experimental + */ + public static function build(string $conversation, array $contextReferences): self + { + return (new self()) + ->setConversation($conversation) + ->setContextReferences($contextReferences); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * @type array|\Google\Protobuf\Internal\MapField $context_references + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. Resource identifier of the conversation to ingest context + * information for. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getContextReferences() + { + return $this->context_references; + } + + /** + * Required. The context references to ingest. The key is the name of the + * context reference and the value contains the contents of the context + * reference. The key is used to incorporate ingested context references to + * enhance the generator. + * + * Generated from protobuf field map context_references = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->context_references = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesResponse.php new file mode 100644 index 000000000000..4be0a55bcb4c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestContextReferencesResponse.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.IngestContextReferencesResponse + */ +class IngestContextReferencesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All context references ingested. + * + * Generated from protobuf field map ingested_context_references = 1; + */ + private $ingested_context_references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $ingested_context_references + * All context references ingested. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * All context references ingested. + * + * Generated from protobuf field map ingested_context_references = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getIngestedContextReferences() + { + return $this->ingested_context_references; + } + + /** + * All context references ingested. + * + * Generated from protobuf field map ingested_context_references = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setIngestedContextReferences($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation\ContextReference::class); + $this->ingested_context_references = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo.php new file mode 100644 index 000000000000..bbbd2494f731 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo.php @@ -0,0 +1,139 @@ +google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo + */ +class IngestedContextReferenceDebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates if the project is allowlisted to use ingested context + * reference. + * + * Generated from protobuf field bool project_not_allowlisted = 1; + */ + protected $project_not_allowlisted = false; + /** + * The status of context_reference retrieval from database. + * + * Generated from protobuf field bool context_reference_retrieved = 2; + */ + protected $context_reference_retrieved = false; + /** + * Parameters ingested from the context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo ingested_parameters_debug_info = 3; + */ + private $ingested_parameters_debug_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $project_not_allowlisted + * Indicates if the project is allowlisted to use ingested context + * reference. + * @type bool $context_reference_retrieved + * The status of context_reference retrieval from database. + * @type \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo\IngestedParameterDebugInfo[] $ingested_parameters_debug_info + * Parameters ingested from the context reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Indicates if the project is allowlisted to use ingested context + * reference. + * + * Generated from protobuf field bool project_not_allowlisted = 1; + * @return bool + */ + public function getProjectNotAllowlisted() + { + return $this->project_not_allowlisted; + } + + /** + * Indicates if the project is allowlisted to use ingested context + * reference. + * + * Generated from protobuf field bool project_not_allowlisted = 1; + * @param bool $var + * @return $this + */ + public function setProjectNotAllowlisted($var) + { + GPBUtil::checkBool($var); + $this->project_not_allowlisted = $var; + + return $this; + } + + /** + * The status of context_reference retrieval from database. + * + * Generated from protobuf field bool context_reference_retrieved = 2; + * @return bool + */ + public function getContextReferenceRetrieved() + { + return $this->context_reference_retrieved; + } + + /** + * The status of context_reference retrieval from database. + * + * Generated from protobuf field bool context_reference_retrieved = 2; + * @param bool $var + * @return $this + */ + public function setContextReferenceRetrieved($var) + { + GPBUtil::checkBool($var); + $this->context_reference_retrieved = $var; + + return $this; + } + + /** + * Parameters ingested from the context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo ingested_parameters_debug_info = 3; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo\IngestedParameterDebugInfo> + */ + public function getIngestedParametersDebugInfo() + { + return $this->ingested_parameters_debug_info; + } + + /** + * Parameters ingested from the context reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo ingested_parameters_debug_info = 3; + * @param \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo\IngestedParameterDebugInfo[] $var + * @return $this + */ + public function setIngestedParametersDebugInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo\IngestedParameterDebugInfo::class); + $this->ingested_parameters_debug_info = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo.php new file mode 100644 index 000000000000..3dadbe054e9b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo + */ +class IngestedParameterDebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the parameter in the context reference. + * + * Generated from protobuf field string parameter = 1; + */ + protected $parameter = ''; + /** + * The ingestion status for this specific parameter. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus ingestion_status = 2; + */ + protected $ingestion_status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parameter + * The name of the parameter in the context reference. + * @type int $ingestion_status + * The ingestion status for this specific parameter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The name of the parameter in the context reference. + * + * Generated from protobuf field string parameter = 1; + * @return string + */ + public function getParameter() + { + return $this->parameter; + } + + /** + * The name of the parameter in the context reference. + * + * Generated from protobuf field string parameter = 1; + * @param string $var + * @return $this + */ + public function setParameter($var) + { + GPBUtil::checkString($var, True); + $this->parameter = $var; + + return $this; + } + + /** + * The ingestion status for this specific parameter. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus ingestion_status = 2; + * @return int + */ + public function getIngestionStatus() + { + return $this->ingestion_status; + } + + /** + * The ingestion status for this specific parameter. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus ingestion_status = 2; + * @param int $var + * @return $this + */ + public function setIngestionStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo\IngestedParameterDebugInfo\IngestionStatus::class); + $this->ingestion_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo/IngestionStatus.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo/IngestionStatus.php new file mode 100644 index 000000000000..92eef3917677 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IngestedContextReferenceDebugInfo/IngestedParameterDebugInfo/IngestionStatus.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus + */ +class IngestionStatus +{ + /** + * Default value, indicates that the ingestion status is not specified. + * + * Generated from protobuf enum INGESTION_STATUS_UNSPECIFIED = 0; + */ + const INGESTION_STATUS_UNSPECIFIED = 0; + /** + * Indicates that the parameter was successfully ingested. + * + * Generated from protobuf enum INGESTION_STATUS_SUCCEEDED = 1; + */ + const INGESTION_STATUS_SUCCEEDED = 1; + /** + * Indicates that the parameter was not available for ingestion. + * + * Generated from protobuf enum INGESTION_STATUS_CONTEXT_NOT_AVAILABLE = 2; + */ + const INGESTION_STATUS_CONTEXT_NOT_AVAILABLE = 2; + /** + * Indicates that there was a failure parsing the parameter content. + * + * Generated from protobuf enum INGESTION_STATUS_PARSE_FAILED = 3; + */ + const INGESTION_STATUS_PARSE_FAILED = 3; + /** + * Indicates that the context reference had an unexpected number of + * content entries as Context reference should only have one entry. + * + * Generated from protobuf enum INGESTION_STATUS_INVALID_ENTRY = 4; + */ + const INGESTION_STATUS_INVALID_ENTRY = 4; + /** + * Indicates that the context reference content was not in the expected + * format (e.g., JSON). + * + * Generated from protobuf enum INGESTION_STATUS_INVALID_FORMAT = 5; + */ + const INGESTION_STATUS_INVALID_FORMAT = 5; + /** + * Indicates that the context reference language does not match the + * conversation language. + * + * Generated from protobuf enum INGESTION_STATUS_LANGUAGE_MISMATCH = 6; + */ + const INGESTION_STATUS_LANGUAGE_MISMATCH = 6; + + private static $valueToName = [ + self::INGESTION_STATUS_UNSPECIFIED => 'INGESTION_STATUS_UNSPECIFIED', + self::INGESTION_STATUS_SUCCEEDED => 'INGESTION_STATUS_SUCCEEDED', + self::INGESTION_STATUS_CONTEXT_NOT_AVAILABLE => 'INGESTION_STATUS_CONTEXT_NOT_AVAILABLE', + self::INGESTION_STATUS_PARSE_FAILED => 'INGESTION_STATUS_PARSE_FAILED', + self::INGESTION_STATUS_INVALID_ENTRY => 'INGESTION_STATUS_INVALID_ENTRY', + self::INGESTION_STATUS_INVALID_FORMAT => 'INGESTION_STATUS_INVALID_FORMAT', + self::INGESTION_STATUS_LANGUAGE_MISMATCH => 'INGESTION_STATUS_LANGUAGE_MISMATCH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php new file mode 100644 index 000000000000..c49bd39405b8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecMetadata + */ +class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $request + * Output only. The original request for initialization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest::class); + $this->request = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php new file mode 100644 index 000000000000..7d2425e6ffa9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest + */ +class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $encryption_spec = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec): self + { + return (new self()) + ->setEncryptionSpec($encryptionSpec); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryption_spec + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php new file mode 100644 index 000000000000..cb1861c3d333 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php @@ -0,0 +1,33 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecResponse + */ +class InitializeEncryptionSpecResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php new file mode 100644 index 000000000000..4438faeb886e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php @@ -0,0 +1,660 @@ +google.cloud.dialogflow.v2.InputAudioConfig + */ +class InputAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sample_rate_hertz = 0; + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not set, the language is inferred from the + * [ConversationProfile.stt_config][google.cloud.dialogflow.v2.ConversationProfile.stt_config]. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + */ + protected $enable_word_info = false; + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @deprecated + */ + private $phrase_hints; + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + */ + private $speech_contexts; + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + */ + protected $model = ''; + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + */ + protected $model_variant = 0; + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + */ + protected $single_utterance = false; + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + */ + protected $disable_no_speech_recognized_event = false; + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + */ + protected $enable_automatic_punctuation = false; + /** + * A collection of phrase set resources to use for speech adaptation. + * + * Generated from protobuf field repeated string phrase_sets = 20 [(.google.api.resource_reference) = { + */ + private $phrase_sets; + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + */ + protected $opt_out_conformer_model_migration = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. Audio encoding of the audio content to process. + * @type int $sample_rate_hertz + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * @type string $language_code + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not set, the language is inferred from the + * [ConversationProfile.stt_config][google.cloud.dialogflow.v2.ConversationProfile.stt_config]. + * @type bool $enable_word_info + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * @type string[] $phrase_hints + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * @type \Google\Cloud\Dialogflow\V2\SpeechContext[] $speech_contexts + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * @type string $model + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * @type int $model_variant + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * @type bool $single_utterance + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * @type bool $disable_no_speech_recognized_event + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * @type bool $enable_automatic_punctuation + * Enable automatic punctuation option at the speech backend. + * @type string[] $phrase_sets + * A collection of phrase set resources to use for speech adaptation. + * @type bool $opt_out_conformer_model_migration + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not set, the language is inferred from the + * [ConversationProfile.stt_config][google.cloud.dialogflow.v2.ConversationProfile.stt_config]. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not set, the language is inferred from the + * [ConversationProfile.stt_config][google.cloud.dialogflow.v2.ConversationProfile.stt_config]. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + * @return bool + */ + public function getEnableWordInfo() + { + return $this->enable_word_info; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + * @param bool $var + * @return $this + */ + public function setEnableWordInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_word_info = $var; + + return $this; + } + + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @return RepeatedField + * @deprecated + */ + public function getPhraseHints() + { + if ($this->phrase_hints->count() !== 0) { + @trigger_error('phrase_hints is deprecated.', E_USER_DEPRECATED); + } + return $this->phrase_hints; + } + + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @param string[] $var + * @return $this + * @deprecated + */ + public function setPhraseHints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + if ($arr->count() !== 0) { + @trigger_error('phrase_hints is deprecated.', E_USER_DEPRECATED); + } + $this->phrase_hints = $arr; + + return $this; + } + + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SpeechContext> + */ + public function getSpeechContexts() + { + return $this->speech_contexts; + } + + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + * @param \Google\Cloud\Dialogflow\V2\SpeechContext[] $var + * @return $this + */ + public function setSpeechContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SpeechContext::class); + $this->speech_contexts = $arr; + + return $this; + } + + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + * @return int + */ + public function getModelVariant() + { + return $this->model_variant; + } + + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + * @param int $var + * @return $this + */ + public function setModelVariant($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); + $this->model_variant = $var; + + return $this; + } + + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + * @return bool + */ + public function getSingleUtterance() + { + return $this->single_utterance; + } + + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + * @param bool $var + * @return $this + */ + public function setSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + * @return bool + */ + public function getDisableNoSpeechRecognizedEvent() + { + return $this->disable_no_speech_recognized_event; + } + + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + * @param bool $var + * @return $this + */ + public function setDisableNoSpeechRecognizedEvent($var) + { + GPBUtil::checkBool($var); + $this->disable_no_speech_recognized_event = $var; + + return $this; + } + + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + * @return bool + */ + public function getEnableAutomaticPunctuation() + { + return $this->enable_automatic_punctuation; + } + + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticPunctuation($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_punctuation = $var; + + return $this; + } + + /** + * A collection of phrase set resources to use for speech adaptation. + * + * Generated from protobuf field repeated string phrase_sets = 20 [(.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getPhraseSets() + { + return $this->phrase_sets; + } + + /** + * A collection of phrase set resources to use for speech adaptation. + * + * Generated from protobuf field repeated string phrase_sets = 20 [(.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setPhraseSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrase_sets = $arr; + + return $this; + } + + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + * @return bool + */ + public function getOptOutConformerModelMigration() + { + return $this->opt_out_conformer_model_migration; + } + + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + * @param bool $var + * @return $this + */ + public function setOptOutConformerModelMigration($var) + { + GPBUtil::checkBool($var); + $this->opt_out_conformer_model_migration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php new file mode 100644 index 000000000000..c56eed8b9ca4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GcsSources $gcs_source + * The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + * matched JSON files, which will be read as one conversation per file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + * matched JSON files, which will be read as one conversation per file. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 1; + * @return \Google\Cloud\Dialogflow\V2\GcsSources|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + * matched JSON files, which will be read as one conversation per file. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GcsSources gcs_source = 1; + * @param \Google\Cloud\Dialogflow\V2\GcsSources $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GcsSources::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php new file mode 100644 index 000000000000..a816ac9f90bc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php @@ -0,0 +1,76 @@ +google.cloud.dialogflow.v2.InputDataset + */ +class InputDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $dataset = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dataset + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataset() + { + return $this->dataset; + } + + /** + * Required. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkString($var, True); + $this->dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php new file mode 100644 index 000000000000..bd68c81d5ec8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.InputTextConfig + */ +class InputTextConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php new file mode 100644 index 000000000000..f77ff0db7466 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php @@ -0,0 +1,904 @@ +google.cloud.dialogflow.v2.Intent + */ +class Intent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The name of this intent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Indicates whether webhooks are enabled for the intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $webhook_state = 0; + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * + * Generated from protobuf field int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $priority = 0; + /** + * Optional. Indicates whether this is a fallback intent. + * + * Generated from protobuf field bool is_fallback = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $is_fallback = false; + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * + * Generated from protobuf field bool ml_disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ml_disabled = false; + /** + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * + * Generated from protobuf field bool live_agent_handoff = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $live_agent_handoff = false; + /** + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * + * Generated from protobuf field bool end_interaction = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end_interaction = false; + /** + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated string input_context_names = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $input_context_names; + /** + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * + * Generated from protobuf field repeated string events = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $events; + /** + * Optional. The collection of examples that the agent is + * trained on. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $training_phrases; + /** + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * + * Generated from protobuf field string action = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $action = ''; + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $output_contexts; + /** + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * + * Generated from protobuf field bool reset_contexts = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reset_contexts = false; + /** + * Optional. The collection of parameters associated with the intent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Parameter parameters = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $parameters; + /** + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $messages; + /** + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Platform default_response_platforms = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $default_response_platforms; + /** + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string root_followup_intent_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $root_followup_intent_name = ''; + /** + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 17; + */ + protected $parent_followup_intent_name = ''; + /** + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $followup_intent_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * @type string $display_name + * Required. The name of this intent. + * @type int $webhook_state + * Optional. Indicates whether webhooks are enabled for the intent. + * @type int $priority + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * @type bool $is_fallback + * Optional. Indicates whether this is a fallback intent. + * @type bool $ml_disabled + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * @type bool $live_agent_handoff + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * @type bool $end_interaction + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * @type string[] $input_context_names + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * @type string[] $events + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * @type \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase[] $training_phrases + * Optional. The collection of examples that the agent is + * trained on. + * @type string $action + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * @type \Google\Cloud\Dialogflow\V2\Context[] $output_contexts + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * @type bool $reset_contexts + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * @type \Google\Cloud\Dialogflow\V2\Intent\Parameter[] $parameters + * Optional. The collection of parameters associated with the intent. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message[] $messages + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * @type int[] $default_response_platforms + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * @type string $root_followup_intent_name + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * @type string $parent_followup_intent_name + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * @type \Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo[] $followup_intent_info + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The unique identifier of this intent. + * Required for + * [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and + * [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents] + * methods. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of this intent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of this intent. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Indicates whether webhooks are enabled for the intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getWebhookState() + { + return $this->webhook_state; + } + + /** + * Optional. Indicates whether webhooks are enabled for the intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.WebhookState webhook_state = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setWebhookState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\WebhookState::class); + $this->webhook_state = $var; + + return $this; + } + + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * + * Generated from protobuf field int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPriority() + { + return $this->priority; + } + + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. + * - If the supplied value is unspecified or 0, the service + * translates the value to 500,000, which corresponds to the + * `Normal` priority in the console. + * - If the supplied value is negative, the intent is ignored + * in runtime detect intent requests. + * + * Generated from protobuf field int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + + /** + * Optional. Indicates whether this is a fallback intent. + * + * Generated from protobuf field bool is_fallback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIsFallback() + { + return $this->is_fallback; + } + + /** + * Optional. Indicates whether this is a fallback intent. + * + * Generated from protobuf field bool is_fallback = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIsFallback($var) + { + GPBUtil::checkBool($var); + $this->is_fallback = $var; + + return $this; + } + + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * + * Generated from protobuf field bool ml_disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getMlDisabled() + { + return $this->ml_disabled; + } + + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + * + * Generated from protobuf field bool ml_disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setMlDisabled($var) + { + GPBUtil::checkBool($var); + $this->ml_disabled = $var; + + return $this; + } + + /** + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * + * Generated from protobuf field bool live_agent_handoff = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getLiveAgentHandoff() + { + return $this->live_agent_handoff; + } + + /** + * Optional. Indicates that a live agent should be brought in to handle the + * interaction with the user. In most cases, when you set this flag to true, + * you would also want to set end_interaction to true as well. Default is + * false. + * + * Generated from protobuf field bool live_agent_handoff = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setLiveAgentHandoff($var) + { + GPBUtil::checkBool($var); + $this->live_agent_handoff = $var; + + return $this; + } + + /** + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * + * Generated from protobuf field bool end_interaction = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEndInteraction() + { + return $this->end_interaction; + } + + /** + * Optional. Indicates that this intent ends an interaction. Some integrations + * (e.g., Actions on Google or Dialogflow phone gateway) use this information + * to close interaction with an end user. Default is false. + * + * Generated from protobuf field bool end_interaction = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEndInteraction($var) + { + GPBUtil::checkBool($var); + $this->end_interaction = $var; + + return $this; + } + + /** + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated string input_context_names = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getInputContextNames() + { + return $this->input_context_names; + } + + /** + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated string input_context_names = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setInputContextNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->input_context_names = $arr; + + return $this; + } + + /** + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * + * Generated from protobuf field repeated string events = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getEvents() + { + return $this->events; + } + + /** + * Optional. The collection of event names that trigger the intent. + * If the collection of input contexts is not empty, all of the contexts must + * be present in the active user session for an event to trigger this intent. + * Event names are limited to 150 characters. + * + * Generated from protobuf field repeated string events = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->events = $arr; + + return $this; + } + + /** + * Optional. The collection of examples that the agent is + * trained on. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase> + */ + public function getTrainingPhrases() + { + return $this->training_phrases; + } + + /** + * Optional. The collection of examples that the agent is + * trained on. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase[] $var + * @return $this + */ + public function setTrainingPhrases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase::class); + $this->training_phrases = $arr; + + return $this; + } + + /** + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * + * Generated from protobuf field string action = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Optional. The name of the action associated with the intent. + * Note: The action name must not contain whitespaces. + * + * Generated from protobuf field string action = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Context> + */ + public function getOutputContexts() + { + return $this->output_contexts; + } + + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the context + * when the intent is matched. + * Format: `projects//agent/sessions/-/contexts/`. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Context[] $var + * @return $this + */ + public function setOutputContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->output_contexts = $arr; + + return $this; + } + + /** + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * + * Generated from protobuf field bool reset_contexts = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getResetContexts() + { + return $this->reset_contexts; + } + + /** + * Optional. Indicates whether to delete all contexts in the current + * session when this intent is matched. + * + * Generated from protobuf field bool reset_contexts = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setResetContexts($var) + { + GPBUtil::checkBool($var); + $this->reset_contexts = $var; + + return $this; + } + + /** + * Optional. The collection of parameters associated with the intent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Parameter parameters = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Parameter> + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Optional. The collection of parameters associated with the intent. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Parameter parameters = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Parameter[] $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Parameter::class); + $this->parameters = $arr; + + return $this; + } + + /** + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message> + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message[] $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Platform default_response_platforms = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getDefaultResponsePlatforms() + { + return $this->default_response_platforms; + } + + /** + * Optional. The list of platforms for which the first responses will be + * copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Platform default_response_platforms = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int[] $var + * @return $this + */ + public function setDefaultResponsePlatforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Intent\Message\Platform::class); + $this->default_response_platforms = $arr; + + return $this; + } + + /** + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string root_followup_intent_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRootFollowupIntentName() + { + return $this->root_followup_intent_name; + } + + /** + * Output only. + * Read-only. The unique identifier of the root intent in the chain of + * followup intents. It identifies the correct followup intents chain for + * this intent. We populate this field only in the output. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string root_followup_intent_name = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRootFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->root_followup_intent_name = $var; + + return $this; + } + + /** + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 17; + * @return string + */ + public function getParentFollowupIntentName() + { + return $this->parent_followup_intent_name; + } + + /** + * Read-only after creation. The unique identifier of the parent intent in the + * chain of followup intents. You can set this field when creating an intent, + * for example with + * [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or + * [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], + * in order to make this intent a followup intent. + * It identifies the parent followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 17; + * @param string $var + * @return $this + */ + public function setParentFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->parent_followup_intent_name = $var; + + return $this; + } + + /** + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo> + */ + public function getFollowupIntentInfo() + { + return $this->followup_intent_info; + } + + /** + * Output only. Read-only. Information about all followup intents that have + * this intent as a direct or indirect parent. We populate this field only in + * the output. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo[] $var + * @return $this + */ + public function setFollowupIntentInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo::class); + $this->followup_intent_info = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php new file mode 100644 index 000000000000..14320537a8cd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php @@ -0,0 +1,109 @@ +google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + */ +class FollowupIntentInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string followup_intent_name = 1; + */ + protected $followup_intent_name = ''; + /** + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 2; + */ + protected $parent_followup_intent_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $followup_intent_name + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * @type string $parent_followup_intent_name + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string followup_intent_name = 1; + * @return string + */ + public function getFollowupIntentName() + { + return $this->followup_intent_name; + } + + /** + * The unique identifier of the followup intent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string followup_intent_name = 1; + * @param string $var + * @return $this + */ + public function setFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->followup_intent_name = $var; + + return $this; + } + + /** + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 2; + * @return string + */ + public function getParentFollowupIntentName() + { + return $this->parent_followup_intent_name; + } + + /** + * The unique identifier of the followup intent's parent. + * Format: `projects//agent/intents/`. + * + * Generated from protobuf field string parent_followup_intent_name = 2; + * @param string $var + * @return $this + */ + public function setParentFollowupIntentName($var) + { + GPBUtil::checkString($var, True); + $this->parent_followup_intent_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php new file mode 100644 index 000000000000..f91a4236d7bd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php @@ -0,0 +1,542 @@ +google.cloud.dialogflow.v2.Intent.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The platform that this message is intended for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Platform platform = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $platform = 0; + protected $message; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Text $text + * The text response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * The image response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies $quick_replies + * The quick replies response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Card $card + * The card response. + * @type \Google\Protobuf\Struct $payload + * A custom platform-specific response. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses $simple_responses + * The voice and text-only responses for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard $basic_card + * The basic card response for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions $suggestions + * The suggestion chips for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion $link_out_suggestion + * The link out suggestion chip for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect $list_select + * The list card response for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect $carousel_select + * The carousel card response for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard $browse_carousel_card + * Browse carousel card for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard $table_card + * Table card for Actions on Google. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent $media_content + * The media content card for Actions on Google. + * @type int $platform + * Optional. The platform that this message is intended for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The text response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Text text = 1; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Text|null + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The text response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Text text = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Text $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Text::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The image response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 2; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->readOneof(2); + } + + public function hasImage() + { + return $this->hasOneof(2); + } + + /** + * The image response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 2; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The quick replies response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.QuickReplies quick_replies = 3; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies|null + */ + public function getQuickReplies() + { + return $this->readOneof(3); + } + + public function hasQuickReplies() + { + return $this->hasOneof(3); + } + + /** + * The quick replies response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.QuickReplies quick_replies = 3; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies $var + * @return $this + */ + public function setQuickReplies($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\QuickReplies::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The card response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Card card = 4; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Card|null + */ + public function getCard() + { + return $this->readOneof(4); + } + + public function hasCard() + { + return $this->hasOneof(4); + } + + /** + * The card response. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Card card = 4; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Card $var + * @return $this + */ + public function setCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Card::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A custom platform-specific response. + * + * Generated from protobuf field .google.protobuf.Struct payload = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->readOneof(5); + } + + public function hasPayload() + { + return $this->hasOneof(5); + } + + /** + * A custom platform-specific response. + * + * Generated from protobuf field .google.protobuf.Struct payload = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The voice and text-only responses for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SimpleResponses simple_responses = 7; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses|null + */ + public function getSimpleResponses() + { + return $this->readOneof(7); + } + + public function hasSimpleResponses() + { + return $this->hasOneof(7); + } + + /** + * The voice and text-only responses for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SimpleResponses simple_responses = 7; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses $var + * @return $this + */ + public function setSimpleResponses($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponses::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The basic card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard basic_card = 8; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard|null + */ + public function getBasicCard() + { + return $this->readOneof(8); + } + + public function hasBasicCard() + { + return $this->hasOneof(8); + } + + /** + * The basic card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard basic_card = 8; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard $var + * @return $this + */ + public function setBasicCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The suggestion chips for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Suggestions suggestions = 9; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions|null + */ + public function getSuggestions() + { + return $this->readOneof(9); + } + + public function hasSuggestions() + { + return $this->hasOneof(9); + } + + /** + * The suggestion chips for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Suggestions suggestions = 9; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions $var + * @return $this + */ + public function setSuggestions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestions::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * The link out suggestion chip for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion link_out_suggestion = 10; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion|null + */ + public function getLinkOutSuggestion() + { + return $this->readOneof(10); + } + + public function hasLinkOutSuggestion() + { + return $this->hasOneof(10); + } + + /** + * The link out suggestion chip for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion link_out_suggestion = 10; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion $var + * @return $this + */ + public function setLinkOutSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\LinkOutSuggestion::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * The list card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ListSelect list_select = 11; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect|null + */ + public function getListSelect() + { + return $this->readOneof(11); + } + + public function hasListSelect() + { + return $this->hasOneof(11); + } + + /** + * The list card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ListSelect list_select = 11; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect $var + * @return $this + */ + public function setListSelect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * The carousel card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect carousel_select = 12; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect|null + */ + public function getCarouselSelect() + { + return $this->readOneof(12); + } + + public function hasCarouselSelect() + { + return $this->hasOneof(12); + } + + /** + * The carousel card response for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect carousel_select = 12; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect $var + * @return $this + */ + public function setCarouselSelect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Browse carousel card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard browse_carousel_card = 22; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard|null + */ + public function getBrowseCarouselCard() + { + return $this->readOneof(22); + } + + public function hasBrowseCarouselCard() + { + return $this->hasOneof(22); + } + + /** + * Browse carousel card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard browse_carousel_card = 22; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard $var + * @return $this + */ + public function setBrowseCarouselCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Table card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.TableCard table_card = 23; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard|null + */ + public function getTableCard() + { + return $this->readOneof(23); + } + + public function hasTableCard() + { + return $this->hasOneof(23); + } + + /** + * Table card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.TableCard table_card = 23; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard $var + * @return $this + */ + public function setTableCard($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\TableCard::class); + $this->writeOneof(23, $var); + + return $this; + } + + /** + * The media content card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent media_content = 24; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent|null + */ + public function getMediaContent() + { + return $this->readOneof(24); + } + + public function hasMediaContent() + { + return $this->hasOneof(24); + } + + /** + * The media content card for Actions on Google. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent media_content = 24; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent $var + * @return $this + */ + public function setMediaContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Optional. The platform that this message is intended for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Platform platform = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Optional. The platform that this message is intended for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Platform platform = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Platform::class); + $this->platform = $var; + + return $this; + } + + /** + * @return string + */ + public function getMessage() + { + return $this->whichOneof("message"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php new file mode 100644 index 000000000000..eb57f33f84e6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php @@ -0,0 +1,213 @@ +google.cloud.dialogflow.v2.Intent.Message.BasicCard + */ +class BasicCard extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + /** + * Required, unless image is present. The body text of the card. + * + * Generated from protobuf field string formatted_text = 3; + */ + protected $formatted_text = ''; + /** + * Optional. The image for the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The title of the card. + * @type string $subtitle + * Optional. The subtitle of the card. + * @type string $formatted_text + * Required, unless image is present. The body text of the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. The image for the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button[] $buttons + * Optional. The collection of card buttons. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * Required, unless image is present. The body text of the card. + * + * Generated from protobuf field string formatted_text = 3; + * @return string + */ + public function getFormattedText() + { + return $this->formatted_text; + } + + /** + * Required, unless image is present. The body text of the card. + * + * Generated from protobuf field string formatted_text = 3; + * @param string $var + * @return $this + */ + public function setFormattedText($var) + { + GPBUtil::checkString($var, True); + $this->formatted_text = $var; + + return $this; + } + + /** + * Optional. The image for the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. The image for the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button> + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button[] $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php new file mode 100644 index 000000000000..cebd34252c0a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + */ +class Button extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The title of the button. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * Required. Action to take when a user taps on the button. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction open_uri_action = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $open_uri_action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. The title of the button. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction $open_uri_action + * Required. Action to take when a user taps on the button. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The title of the button. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The title of the button. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Required. Action to take when a user taps on the button. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction open_uri_action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction|null + */ + public function getOpenUriAction() + { + return $this->open_uri_action; + } + + public function hasOpenUriAction() + { + return isset($this->open_uri_action); + } + + public function clearOpenUriAction() + { + unset($this->open_uri_action); + } + + /** + * Required. Action to take when a user taps on the button. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction open_uri_action = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction $var + * @return $this + */ + public function setOpenUriAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button\OpenUriAction::class); + $this->open_uri_action = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php new file mode 100644 index 000000000000..26576f23d5c2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + */ +class OpenUriAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The HTTP or HTTPS scheme URI. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. The HTTP or HTTPS scheme URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The HTTP or HTTPS scheme URI. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The HTTP or HTTPS scheme URI. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php new file mode 100644 index 000000000000..8a314faa6df5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + */ +class BrowseCarouselCard extends \Google\Protobuf\Internal\Message +{ + /** + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem items = 1; + */ + private $items; + /** + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions image_display_options = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_display_options = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem[] $items + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * @type int $image_display_options + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem items = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem> + */ + public function getItems() + { + return $this->items; + } + + /** + * Required. List of items in the Browse Carousel Card. Minimum of two + * items, maximum of ten. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem items = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem[] $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem::class); + $this->items = $arr; + + return $this; + } + + /** + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions image_display_options = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getImageDisplayOptions() + { + return $this->image_display_options; + } + + /** + * Optional. Settings for displaying the image. Applies to every image in + * [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions image_display_options = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setImageDisplayOptions($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\ImageDisplayOptions::class); + $this->image_display_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php new file mode 100644 index 000000000000..16fe5362ba91 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php @@ -0,0 +1,231 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + */ +class BrowseCarouselCardItem extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Action to present to the user. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction open_uri_action = 1; + */ + protected $open_uri_action = null; + /** + * Required. Title of the carousel item. Maximum of two lines of text. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + /** + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Hero image for the carousel item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + /** + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * + * Generated from protobuf field string footer = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $footer = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction $open_uri_action + * Required. Action to present to the user. + * @type string $title + * Required. Title of the carousel item. Maximum of two lines of text. + * @type string $description + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. Hero image for the carousel item. + * @type string $footer + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Action to present to the user. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction open_uri_action = 1; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction|null + */ + public function getOpenUriAction() + { + return $this->open_uri_action; + } + + public function hasOpenUriAction() + { + return isset($this->open_uri_action); + } + + public function clearOpenUriAction() + { + unset($this->open_uri_action); + } + + /** + * Required. Action to present to the user. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction open_uri_action = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction $var + * @return $this + */ + public function setOpenUriAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction::class); + $this->open_uri_action = $var; + + return $this; + } + + /** + * Required. Title of the carousel item. Maximum of two lines of text. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Title of the carousel item. Maximum of two lines of text. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the carousel item. Maximum of four lines of + * text. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Hero image for the carousel item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. Hero image for the carousel item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * + * Generated from protobuf field string footer = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFooter() + { + return $this->footer; + } + + /** + * Optional. Text that appears at the bottom of the Browse Carousel + * Card. Maximum of one line of text. + * + * Generated from protobuf field string footer = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFooter($var) + { + GPBUtil::checkString($var, True); + $this->footer = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php new file mode 100644 index 000000000000..3354b09a89bc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + */ +class OpenUrlAction extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URL + * + * Generated from protobuf field string url = 1; + */ + protected $url = ''; + /** + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint url_type_hint = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $url_type_hint = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Required. URL + * @type int $url_type_hint + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. URL + * + * Generated from protobuf field string url = 1; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Required. URL + * + * Generated from protobuf field string url = 1; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint url_type_hint = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getUrlTypeHint() + { + return $this->url_type_hint; + } + + /** + * Optional. Specifies the type of viewer that is used when opening + * the URL. Defaults to opening via web browser. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint url_type_hint = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setUrlTypeHint($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem\OpenUrlAction\UrlTypeHint::class); + $this->url_type_hint = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php new file mode 100644 index 000000000000..811b67dd8203 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint + */ +class UrlTypeHint +{ + /** + * Unspecified + * + * Generated from protobuf enum URL_TYPE_HINT_UNSPECIFIED = 0; + */ + const URL_TYPE_HINT_UNSPECIFIED = 0; + /** + * Url would be an amp action + * + * Generated from protobuf enum AMP_ACTION = 1; + */ + const AMP_ACTION = 1; + /** + * URL that points directly to AMP content, or to a canonical URL + * which refers to AMP content via . + * + * Generated from protobuf enum AMP_CONTENT = 2; + */ + const AMP_CONTENT = 2; + + private static $valueToName = [ + self::URL_TYPE_HINT_UNSPECIFIED => 'URL_TYPE_HINT_UNSPECIFIED', + self::AMP_ACTION => 'AMP_ACTION', + self::AMP_CONTENT => 'AMP_CONTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php new file mode 100644 index 000000000000..2947dec0cb37 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions + */ +class ImageDisplayOptions +{ + /** + * Fill the gaps between the image and the image container with gray + * bars. + * + * Generated from protobuf enum IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0; + */ + const IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0; + /** + * Fill the gaps between the image and the image container with gray + * bars. + * + * Generated from protobuf enum GRAY = 1; + */ + const GRAY = 1; + /** + * Fill the gaps between the image and the image container with white + * bars. + * + * Generated from protobuf enum WHITE = 2; + */ + const WHITE = 2; + /** + * Image is scaled such that the image width and height match or exceed + * the container dimensions. This may crop the top and bottom of the + * image if the scaled image height is greater than the container + * height, or crop the left and right of the image if the scaled image + * width is greater than the container width. This is similar to "Zoom + * Mode" on a widescreen TV when playing a 4:3 video. + * + * Generated from protobuf enum CROPPED = 3; + */ + const CROPPED = 3; + /** + * Pad the gaps between image and image frame with a blurred copy of the + * same image. + * + * Generated from protobuf enum BLURRED_BACKGROUND = 4; + */ + const BLURRED_BACKGROUND = 4; + + private static $valueToName = [ + self::IMAGE_DISPLAY_OPTIONS_UNSPECIFIED => 'IMAGE_DISPLAY_OPTIONS_UNSPECIFIED', + self::GRAY => 'GRAY', + self::WHITE => 'WHITE', + self::CROPPED => 'CROPPED', + self::BLURRED_BACKGROUND => 'BLURRED_BACKGROUND', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php new file mode 100644 index 000000000000..adfcfcd33e99 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php @@ -0,0 +1,169 @@ +google.cloud.dialogflow.v2.Intent.Message.Card + */ +class Card extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + /** + * Optional. The public URI to an image file for the card. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_uri = ''; + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Card.Button buttons = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The title of the card. + * @type string $subtitle + * Optional. The subtitle of the card. + * @type string $image_uri + * Optional. The public URI to an image file for the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button[] $buttons + * Optional. The collection of card buttons. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The title of the card. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. The subtitle of the card. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * Optional. The public URI to an image file for the card. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Optional. The public URI to an image file for the card. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Card.Button buttons = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button> + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * Optional. The collection of card buttons. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Card.Button buttons = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button[] $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php new file mode 100644 index 000000000000..e2a63dd69446 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.Intent.Message.Card.Button + */ +class Button extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The text to show on the button. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + /** + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * + * Generated from protobuf field string postback = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $postback = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Optional. The text to show on the button. + * @type string $postback + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The text to show on the button. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. The text to show on the button. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * + * Generated from protobuf field string postback = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPostback() + { + return $this->postback; + } + + /** + * Optional. The text to send back to the Dialogflow API or a URI to + * open. + * + * Generated from protobuf field string postback = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPostback($var) + { + GPBUtil::checkString($var, True); + $this->postback = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php new file mode 100644 index 000000000000..b675aef238c8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + */ +class CarouselSelect extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Carousel items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item[] $items + * Required. Carousel items. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Carousel items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item> + */ + public function getItems() + { + return $this->items; + } + + /** + * Required. Carousel items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item items = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item[] $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item::class); + $this->items = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php new file mode 100644 index 000000000000..b2c7c4b6c229 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php @@ -0,0 +1,189 @@ +google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + */ +class Item extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Additional info about the option item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $info = null; + /** + * Required. Title of the carousel item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + /** + * Optional. The body text of the card. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $info + * Required. Additional info about the option item. + * @type string $title + * Required. Title of the carousel item. + * @type string $description + * Optional. The body text of the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. The image to display. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Additional info about the option item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo|null + */ + public function getInfo() + { + return $this->info; + } + + public function hasInfo() + { + return isset($this->info); + } + + public function clearInfo() + { + unset($this->info); + } + + /** + * Required. Additional info about the option item. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $var + * @return $this + */ + public function setInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo::class); + $this->info = $var; + + return $this; + } + + /** + * Required. Title of the carousel item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Title of the carousel item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The body text of the card. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The body text of the card. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php new file mode 100644 index 000000000000..8d9ee397993e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php @@ -0,0 +1,102 @@ +google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + */ +class ColumnProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Column heading. + * + * Generated from protobuf field string header = 1; + */ + protected $header = ''; + /** + * Optional. Defines text alignment for all cells in this column. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment horizontal_alignment = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $horizontal_alignment = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header + * Required. Column heading. + * @type int $horizontal_alignment + * Optional. Defines text alignment for all cells in this column. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Column heading. + * + * Generated from protobuf field string header = 1; + * @return string + */ + public function getHeader() + { + return $this->header; + } + + /** + * Required. Column heading. + * + * Generated from protobuf field string header = 1; + * @param string $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkString($var, True); + $this->header = $var; + + return $this; + } + + /** + * Optional. Defines text alignment for all cells in this column. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment horizontal_alignment = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHorizontalAlignment() + { + return $this->horizontal_alignment; + } + + /** + * Optional. Defines text alignment for all cells in this column. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment horizontal_alignment = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHorizontalAlignment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties\HorizontalAlignment::class); + $this->horizontal_alignment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php new file mode 100644 index 000000000000..72fc33998f1f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment + */ +class HorizontalAlignment +{ + /** + * Text is aligned to the leading edge of the column. + * + * Generated from protobuf enum HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + */ + const HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + /** + * Text is aligned to the leading edge of the column. + * + * Generated from protobuf enum LEADING = 1; + */ + const LEADING = 1; + /** + * Text is centered in the column. + * + * Generated from protobuf enum CENTER = 2; + */ + const CENTER = 2; + /** + * Text is aligned to the trailing edge of the column. + * + * Generated from protobuf enum TRAILING = 3; + */ + const TRAILING = 3; + + private static $valueToName = [ + self::HORIZONTAL_ALIGNMENT_UNSPECIFIED => 'HORIZONTAL_ALIGNMENT_UNSPECIFIED', + self::LEADING => 'LEADING', + self::CENTER => 'CENTER', + self::TRAILING => 'TRAILING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php new file mode 100644 index 000000000000..2185a1010b75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.Intent.Message.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The public URI to an image file. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image_uri = ''; + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * + * Generated from protobuf field string accessibility_text = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accessibility_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_uri + * Optional. The public URI to an image file. + * @type string $accessibility_text + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The public URI to an image file. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Optional. The public URI to an image file. + * + * Generated from protobuf field string image_uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * + * Generated from protobuf field string accessibility_text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAccessibilityText() + { + return $this->accessibility_text; + } + + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + * + * Generated from protobuf field string accessibility_text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAccessibilityText($var) + { + GPBUtil::checkString($var, True); + $this->accessibility_text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php new file mode 100644 index 000000000000..c7c89e66f27e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + */ +class LinkOutSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the app or site this chip is linking to. + * + * Generated from protobuf field string destination_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $destination_name = ''; + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $destination_name + * Required. The name of the app or site this chip is linking to. + * @type string $uri + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the app or site this chip is linking to. + * + * Generated from protobuf field string destination_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDestinationName() + { + return $this->destination_name; + } + + /** + * Required. The name of the app or site this chip is linking to. + * + * Generated from protobuf field string destination_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDestinationName($var) + { + GPBUtil::checkString($var, True); + $this->destination_name = $var; + + return $this; + } + + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php new file mode 100644 index 000000000000..fd1125d155d3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php @@ -0,0 +1,135 @@ +google.cloud.dialogflow.v2.Intent.Message.ListSelect + */ +class ListSelect extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The overall title of the list. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Required. List items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item items = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $items; + /** + * Optional. Subtitle of the list. + * + * Generated from protobuf field string subtitle = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The overall title of the list. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item[] $items + * Required. List items. + * @type string $subtitle + * Optional. Subtitle of the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The overall title of the list. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The overall title of the list. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Required. List items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item items = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item> + */ + public function getItems() + { + return $this->items; + } + + /** + * Required. List items. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item items = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item[] $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item::class); + $this->items = $arr; + + return $this; + } + + /** + * Optional. Subtitle of the list. + * + * Generated from protobuf field string subtitle = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. Subtitle of the list. + * + * Generated from protobuf field string subtitle = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php new file mode 100644 index 000000000000..fe1e3d66fd79 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php @@ -0,0 +1,189 @@ +google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + */ +class Item extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Additional information about this option. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $info = null; + /** + * Required. The title of the list item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + /** + * Optional. The main text describing the item. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $info + * Required. Additional information about this option. + * @type string $title + * Required. The title of the list item. + * @type string $description + * Optional. The main text describing the item. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. The image to display. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Additional information about this option. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo|null + */ + public function getInfo() + { + return $this->info; + } + + public function hasInfo() + { + return isset($this->info); + } + + public function clearInfo() + { + unset($this->info); + } + + /** + * Required. Additional information about this option. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo info = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo $var + * @return $this + */ + public function setInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\SelectItemInfo::class); + $this->info = $var; + + return $this; + } + + /** + * Required. The title of the list item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The title of the list item. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The main text describing the item. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The main text describing the item. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. The image to display. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php new file mode 100644 index 000000000000..c25639bba4f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.Intent.Message.MediaContent + */ +class MediaContent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. What type of media is the content (ie "audio"). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType media_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $media_type = 0; + /** + * Required. List of media objects. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject media_objects = 2; + */ + private $media_objects; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $media_type + * Optional. What type of media is the content (ie "audio"). + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject[] $media_objects + * Required. List of media objects. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. What type of media is the content (ie "audio"). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType media_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMediaType() + { + return $this->media_type; + } + + /** + * Optional. What type of media is the content (ie "audio"). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType media_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMediaType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaType::class); + $this->media_type = $var; + + return $this; + } + + /** + * Required. List of media objects. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject media_objects = 2; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject> + */ + public function getMediaObjects() + { + return $this->media_objects; + } + + /** + * Required. List of media objects. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject media_objects = 2; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject[] $var + * @return $this + */ + public function setMediaObjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject::class); + $this->media_objects = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php new file mode 100644 index 000000000000..f5900a43ecb0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php @@ -0,0 +1,210 @@ +google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + */ +class ResponseMediaObject extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of media card. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Description of media card. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. Url where the media is stored. + * + * Generated from protobuf field string content_url = 5; + */ + protected $content_url = ''; + protected $image; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of media card. + * @type string $description + * Optional. Description of media card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $large_image + * Optional. Image to display above media content. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $icon + * Optional. Icon to display above media content. + * @type string $content_url + * Required. Url where the media is stored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of media card. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of media card. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Description of media card. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of media card. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Image to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image large_image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getLargeImage() + { + return $this->readOneof(3); + } + + public function hasLargeImage() + { + return $this->hasOneof(3); + } + + /** + * Optional. Image to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image large_image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setLargeImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Icon to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image icon = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getIcon() + { + return $this->readOneof(4); + } + + public function hasIcon() + { + return $this->hasOneof(4); + } + + /** + * Optional. Icon to display above media content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image icon = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Required. Url where the media is stored. + * + * Generated from protobuf field string content_url = 5; + * @return string + */ + public function getContentUrl() + { + return $this->content_url; + } + + /** + * Required. Url where the media is stored. + * + * Generated from protobuf field string content_url = 5; + * @param string $var + * @return $this + */ + public function setContentUrl($var) + { + GPBUtil::checkString($var, True); + $this->content_url = $var; + + return $this; + } + + /** + * @return string + */ + public function getImage() + { + return $this->whichOneof("image"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php new file mode 100644 index 000000000000..b55e313452ff --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php @@ -0,0 +1,54 @@ +google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType + */ +class ResponseMediaType +{ + /** + * Unspecified. + * + * Generated from protobuf enum RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0; + */ + const RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0; + /** + * Response media type is audio. + * + * Generated from protobuf enum AUDIO = 1; + */ + const AUDIO = 1; + + private static $valueToName = [ + self::RESPONSE_MEDIA_TYPE_UNSPECIFIED => 'RESPONSE_MEDIA_TYPE_UNSPECIFIED', + self::AUDIO => 'AUDIO', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php new file mode 100644 index 000000000000..a28148909992 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php @@ -0,0 +1,113 @@ +google.cloud.dialogflow.v2.Intent.Message.Platform + */ +class Platform +{ + /** + * Default platform. + * + * Generated from protobuf enum PLATFORM_UNSPECIFIED = 0; + */ + const PLATFORM_UNSPECIFIED = 0; + /** + * Facebook. + * + * Generated from protobuf enum FACEBOOK = 1; + */ + const FACEBOOK = 1; + /** + * Slack. + * + * Generated from protobuf enum SLACK = 2; + */ + const SLACK = 2; + /** + * Telegram. + * + * Generated from protobuf enum TELEGRAM = 3; + */ + const TELEGRAM = 3; + /** + * Kik. + * + * Generated from protobuf enum KIK = 4; + */ + const KIK = 4; + /** + * Skype. + * + * Generated from protobuf enum SKYPE = 5; + */ + const SKYPE = 5; + /** + * Line. + * + * Generated from protobuf enum LINE = 6; + */ + const LINE = 6; + /** + * Viber. + * + * Generated from protobuf enum VIBER = 7; + */ + const VIBER = 7; + /** + * Google Assistant + * See [Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf enum ACTIONS_ON_GOOGLE = 8; + */ + const ACTIONS_ON_GOOGLE = 8; + /** + * Google Hangouts. + * + * Generated from protobuf enum GOOGLE_HANGOUTS = 11; + */ + const GOOGLE_HANGOUTS = 11; + + private static $valueToName = [ + self::PLATFORM_UNSPECIFIED => 'PLATFORM_UNSPECIFIED', + self::FACEBOOK => 'FACEBOOK', + self::SLACK => 'SLACK', + self::TELEGRAM => 'TELEGRAM', + self::KIK => 'KIK', + self::SKYPE => 'SKYPE', + self::LINE => 'LINE', + self::VIBER => 'VIBER', + self::ACTIONS_ON_GOOGLE => 'ACTIONS_ON_GOOGLE', + self::GOOGLE_HANGOUTS => 'GOOGLE_HANGOUTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php new file mode 100644 index 000000000000..49b0fe99db56 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.Intent.Message.QuickReplies + */ +class QuickReplies extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The title of the collection of quick replies. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $title = ''; + /** + * Optional. The collection of quick replies. + * + * Generated from protobuf field repeated string quick_replies = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $quick_replies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Optional. The title of the collection of quick replies. + * @type string[] $quick_replies + * Optional. The collection of quick replies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The title of the collection of quick replies. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Optional. The title of the collection of quick replies. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. The collection of quick replies. + * + * Generated from protobuf field repeated string quick_replies = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getQuickReplies() + { + return $this->quick_replies; + } + + /** + * Optional. The collection of quick replies. + * + * Generated from protobuf field repeated string quick_replies = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setQuickReplies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->quick_replies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php new file mode 100644 index 000000000000..03c9273cf70a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + */ +class SelectItemInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key = ''; + /** + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $synonyms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Required. A unique key that will be sent back to the agent if this + * response is given. + * @type string[] $synonyms + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Optional. A list of synonyms that can also be used to trigger this + * item in dialog. + * + * Generated from protobuf field repeated string synonyms = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php new file mode 100644 index 000000000000..ba9e8ec102e7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + */ +class SimpleResponse extends \Google\Protobuf\Internal\Message +{ + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * + * Generated from protobuf field string text_to_speech = 1; + */ + protected $text_to_speech = ''; + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * + * Generated from protobuf field string ssml = 2; + */ + protected $ssml = ''; + /** + * Optional. The text to display. + * + * Generated from protobuf field string display_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text_to_speech + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * @type string $ssml + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * @type string $display_text + * Optional. The text to display. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * + * Generated from protobuf field string text_to_speech = 1; + * @return string + */ + public function getTextToSpeech() + { + return $this->text_to_speech; + } + + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + * + * Generated from protobuf field string text_to_speech = 1; + * @param string $var + * @return $this + */ + public function setTextToSpeech($var) + { + GPBUtil::checkString($var, True); + $this->text_to_speech = $var; + + return $this; + } + + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * + * Generated from protobuf field string ssml = 2; + * @return string + */ + public function getSsml() + { + return $this->ssml; + } + + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + * + * Generated from protobuf field string ssml = 2; + * @param string $var + * @return $this + */ + public function setSsml($var) + { + GPBUtil::checkString($var, True); + $this->ssml = $var; + + return $this; + } + + /** + * Optional. The text to display. + * + * Generated from protobuf field string display_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayText() + { + return $this->display_text; + } + + /** + * Optional. The text to display. + * + * Generated from protobuf field string display_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayText($var) + { + GPBUtil::checkString($var, True); + $this->display_text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php new file mode 100644 index 000000000000..5ce36848b1bd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + */ +class SimpleResponses extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of simple responses. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.SimpleResponse simple_responses = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $simple_responses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse[] $simple_responses + * Required. The list of simple responses. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of simple responses. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.SimpleResponse simple_responses = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse> + */ + public function getSimpleResponses() + { + return $this->simple_responses; + } + + /** + * Required. The list of simple responses. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.SimpleResponse simple_responses = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse[] $var + * @return $this + */ + public function setSimpleResponses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse::class); + $this->simple_responses = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php new file mode 100644 index 000000000000..f0f717e41a23 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.Suggestion + */ +class Suggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The text shown the in the suggestion chip. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. The text shown the in the suggestion chip. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The text shown the in the suggestion chip. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The text shown the in the suggestion chip. + * + * Generated from protobuf field string title = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php new file mode 100644 index 000000000000..5a27fa0478f9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Intent.Message.Suggestions + */ +class Suggestions extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of suggested replies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Suggestion suggestions = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $suggestions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion[] $suggestions + * Required. The list of suggested replies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of suggested replies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Suggestion suggestions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion> + */ + public function getSuggestions() + { + return $this->suggestions; + } + + /** + * Required. The list of suggested replies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.Suggestion suggestions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion[] $var + * @return $this + */ + public function setSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion::class); + $this->suggestions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php new file mode 100644 index 000000000000..ca6752cef80d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php @@ -0,0 +1,247 @@ +google.cloud.dialogflow.v2.Intent.Message.TableCard + */ +class TableCard extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Title of the card. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * Optional. Subtitle to the title. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subtitle = ''; + /** + * Optional. Image which should be displayed on the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + /** + * Optional. Display properties for the columns in this table. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties column_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $column_properties; + /** + * Optional. Rows in this table of data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardRow rows = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rows; + /** + * Optional. List of buttons for the card. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. Title of the card. + * @type string $subtitle + * Optional. Subtitle to the title. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\Image $image + * Optional. Image which should be displayed on the card. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties[] $column_properties + * Optional. Display properties for the columns in this table. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow[] $rows + * Optional. Rows in this table of data. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button[] $buttons + * Optional. List of buttons for the card. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Title of the card. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Title of the card. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. Subtitle to the title. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Optional. Subtitle to the title. + * + * Generated from protobuf field string subtitle = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * Optional. Image which should be displayed on the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Intent\Message\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. Image which should be displayed on the card. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.Message.Image image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent\Message\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Optional. Display properties for the columns in this table. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties column_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties> + */ + public function getColumnProperties() + { + return $this->column_properties; + } + + /** + * Optional. Display properties for the columns in this table. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.ColumnProperties column_properties = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties[] $var + * @return $this + */ + public function setColumnProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties::class); + $this->column_properties = $arr; + + return $this; + } + + /** + * Optional. Rows in this table of data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardRow rows = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow> + */ + public function getRows() + { + return $this->rows; + } + + /** + * Optional. Rows in this table of data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardRow rows = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow[] $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow::class); + $this->rows = $arr; + + return $this; + } + + /** + * Optional. List of buttons for the card. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button> + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * Optional. List of buttons for the card. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button buttons = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button[] $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php new file mode 100644 index 000000000000..5cd63f8d5e21 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Intent.Message.TableCardCell + */ +class TableCardCell extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Text in this cell. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. Text in this cell. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Text in this cell. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. Text in this cell. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php new file mode 100644 index 000000000000..beb79a95c2b1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.Intent.Message.TableCardRow + */ +class TableCardRow extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardCell cells = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $cells; + /** + * Optional. Whether to add a visual divider after this row. + * + * Generated from protobuf field bool divider_after = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $divider_after = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell[] $cells + * Optional. List of cells that make up this row. + * @type bool $divider_after + * Optional. Whether to add a visual divider after this row. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardCell cells = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell> + */ + public function getCells() + { + return $this->cells; + } + + /** + * Optional. List of cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message.TableCardCell cells = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell[] $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell::class); + $this->cells = $arr; + + return $this; + } + + /** + * Optional. Whether to add a visual divider after this row. + * + * Generated from protobuf field bool divider_after = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDividerAfter() + { + return $this->divider_after; + } + + /** + * Optional. Whether to add a visual divider after this row. + * + * Generated from protobuf field bool divider_after = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDividerAfter($var) + { + GPBUtil::checkBool($var); + $this->divider_after = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php new file mode 100644 index 000000000000..c63a61727d75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Intent.Message.Text + */ +class Text extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The collection of the agent's responses. + * + * Generated from protobuf field repeated string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $text; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $text + * Optional. The collection of the agent's responses. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The collection of the agent's responses. + * + * Generated from protobuf field repeated string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. The collection of the agent's responses. + * + * Generated from protobuf field repeated string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setText($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->text = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php new file mode 100644 index 000000000000..c6212c02d157 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php @@ -0,0 +1,357 @@ +google.cloud.dialogflow.v2.Intent.Parameter + */ +class Parameter extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of this parameter. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + /** + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * + * Generated from protobuf field string default_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_value = ''; + /** + * Optional. The name of the entity type, prefixed with `\@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * + * Generated from protobuf field string entity_type_display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $entity_type_display_name = ''; + /** + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * + * Generated from protobuf field bool mandatory = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mandatory = false; + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * + * Generated from protobuf field repeated string prompts = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $prompts; + /** + * Optional. Indicates whether the parameter represents a list of values. + * + * Generated from protobuf field bool is_list = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $is_list = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The unique identifier of this parameter. + * @type string $display_name + * Required. The name of the parameter. + * @type string $value + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * @type string $default_value + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * @type string $entity_type_display_name + * Optional. The name of the entity type, prefixed with `\@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * @type bool $mandatory + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * @type string[] $prompts + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * @type bool $is_list + * Optional. Indicates whether the parameter represents a list of values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of this parameter. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique identifier of this parameter. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The definition of the parameter value. It can be: + * - a constant string, + * - a parameter value defined as `$parameter_name`, + * - an original parameter value defined as `$parameter_name.original`, + * - a parameter value from some context defined as + * `#context_name.parameter_name`. + * + * Generated from protobuf field string value = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * + * Generated from protobuf field string default_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefaultValue() + { + return $this->default_value; + } + + /** + * Optional. The default value to use when the `value` yields an empty + * result. + * Default values can be extracted from contexts by using the following + * syntax: `#context_name.parameter_name`. + * + * Generated from protobuf field string default_value = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + + /** + * Optional. The name of the entity type, prefixed with `\@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * + * Generated from protobuf field string entity_type_display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEntityTypeDisplayName() + { + return $this->entity_type_display_name; + } + + /** + * Optional. The name of the entity type, prefixed with `\@`, that + * describes values of the parameter. If the parameter is + * required, this must be provided. + * + * Generated from protobuf field string entity_type_display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEntityTypeDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->entity_type_display_name = $var; + + return $this; + } + + /** + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * + * Generated from protobuf field bool mandatory = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getMandatory() + { + return $this->mandatory; + } + + /** + * Optional. Indicates whether the parameter is required. That is, + * whether the intent cannot be completed without collecting the parameter + * value. + * + * Generated from protobuf field bool mandatory = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setMandatory($var) + { + GPBUtil::checkBool($var); + $this->mandatory = $var; + + return $this; + } + + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * + * Generated from protobuf field repeated string prompts = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getPrompts() + { + return $this->prompts; + } + + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect a value for the parameter. + * + * Generated from protobuf field repeated string prompts = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setPrompts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->prompts = $arr; + + return $this; + } + + /** + * Optional. Indicates whether the parameter represents a list of values. + * + * Generated from protobuf field bool is_list = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIsList() + { + return $this->is_list; + } + + /** + * Optional. Indicates whether the parameter represents a list of values. + * + * Generated from protobuf field bool is_list = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIsList($var) + { + GPBUtil::checkBool($var); + $this->is_list = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php new file mode 100644 index 000000000000..0a71026543db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php @@ -0,0 +1,237 @@ +google.cloud.dialogflow.v2.Intent.TrainingPhrase + */ +class TrainingPhrase extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this training phrase. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The type of the training phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $parts; + /** + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * + * Generated from protobuf field int32 times_added_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $times_added_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique identifier of this training phrase. + * @type int $type + * Required. The type of the training phrase. + * @type \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part[] $parts + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * @type int $times_added_count + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this training phrase. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this training phrase. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The type of the training phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of the training phrase. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part> + */ + public function getParts() + { + return $this->parts; + } + + /** + * Required. The ordered list of training phrase parts. + * The parts are concatenated in order to form the training phrase. + * Note: The API does not automatically annotate training phrases like the + * Dialogflow Console does. + * Note: Do not forget to include whitespace at part boundaries, + * so the training phrase is well formatted when the parts are concatenated. + * If the training phrase does not need to be annotated with parameters, + * you just need a single part with only the + * [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] + * field set. + * If you want to annotate the training phrase, you must create multiple + * parts, where the fields of each part are populated in one of two ways: + * - `Part.text` is set to a part of the phrase that has no parameters. + * - `Part.text` is set to a part of the phrase that you want to annotate, + * and the `entity_type`, `alias`, and `user_defined` fields are all + * set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part[] $var + * @return $this + */ + public function setParts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part::class); + $this->parts = $arr; + + return $this; + } + + /** + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * + * Generated from protobuf field int32 times_added_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimesAddedCount() + { + return $this->times_added_count; + } + + /** + * Optional. Indicates how many times this example was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + * + * Generated from protobuf field int32 times_added_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimesAddedCount($var) + { + GPBUtil::checkInt32($var); + $this->times_added_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php new file mode 100644 index 000000000000..ff84c75a7df9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php @@ -0,0 +1,193 @@ +google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + */ +class Part extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The text for this part. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * Optional. The entity type name prefixed with `\@`. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $entity_type = ''; + /** + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string alias = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alias = ''; + /** + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * + * Generated from protobuf field bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_defined = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. The text for this part. + * @type string $entity_type + * Optional. The entity type name prefixed with `\@`. + * This field is required for annotated parts of the training phrase. + * @type string $alias + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * @type bool $user_defined + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The text for this part. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The text for this part. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The entity type name prefixed with `\@`. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEntityType() + { + return $this->entity_type; + } + + /** + * Optional. The entity type name prefixed with `\@`. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkString($var, True); + $this->entity_type = $var; + + return $this; + } + + /** + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string alias = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * Optional. The parameter name for the value extracted from the + * annotated part of the example. + * This field is required for annotated parts of the training phrase. + * + * Generated from protobuf field string alias = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlias($var) + { + GPBUtil::checkString($var, True); + $this->alias = $var; + + return $this; + } + + /** + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * + * Generated from protobuf field bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUserDefined() + { + return $this->user_defined; + } + + /** + * Optional. Indicates whether the text was manually annotated. + * This field is set to true when the Dialogflow Console is used to + * manually annotate the part. When creating an annotated part with the + * API, you must set this to true. + * + * Generated from protobuf field bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUserDefined($var) + { + GPBUtil::checkBool($var); + $this->user_defined = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php new file mode 100644 index 000000000000..ac534582aa2b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type + */ +class Type +{ + /** + * Not specified. This value should never be used. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Examples do not contain \@-prefixed entity type names, but example parts + * can be annotated with entity types. + * + * Generated from protobuf enum EXAMPLE = 1; + */ + const EXAMPLE = 1; + /** + * Templates are not annotated with entity types, but they can contain + * \@-prefixed entity type names as substrings. + * Template mode has been deprecated. Example mode is the only supported + * way to create new training phrases. If you have existing training + * phrases that you've created in template mode, those will continue to + * work. + * + * Generated from protobuf enum TEMPLATE = 2 [deprecated = true]; + */ + const TEMPLATE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::EXAMPLE => 'EXAMPLE', + self::TEMPLATE => 'TEMPLATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php new file mode 100644 index 000000000000..f323b7e31d75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.Intent.WebhookState + */ +class WebhookState +{ + /** + * Webhook is disabled in the agent and in the intent. + * + * Generated from protobuf enum WEBHOOK_STATE_UNSPECIFIED = 0; + */ + const WEBHOOK_STATE_UNSPECIFIED = 0; + /** + * Webhook is enabled in the agent and in the intent. + * + * Generated from protobuf enum WEBHOOK_STATE_ENABLED = 1; + */ + const WEBHOOK_STATE_ENABLED = 1; + /** + * Webhook is enabled in the agent and in the intent. Also, each slot + * filling prompt is forwarded to the webhook. + * + * Generated from protobuf enum WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + */ + const WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + + private static $valueToName = [ + self::WEBHOOK_STATE_UNSPECIFIED => 'WEBHOOK_STATE_UNSPECIFIED', + self::WEBHOOK_STATE_ENABLED => 'WEBHOOK_STATE_ENABLED', + self::WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING => 'WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php new file mode 100644 index 000000000000..0bea316e9304 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.IntentBatch + */ +class IntentBatch extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + */ + private $intents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent[] $intents + * A collection of intents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent> + */ + public function getIntents() + { + return $this->intents; + } + + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent[] $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php new file mode 100644 index 000000000000..8f01f10a8792 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.IntentSuggestion + */ +class IntentSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + */ + protected $description = ''; + protected $intent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the intent. + * @type string $intent_v2 + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * @type string $description + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * + * Generated from protobuf field string intent_v2 = 2; + * @return string + */ + public function getIntentV2() + { + return $this->readOneof(2); + } + + public function hasIntentV2() + { + return $this->hasOneof(2); + } + + /** + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * + * Generated from protobuf field string intent_v2 = 2; + * @param string $var + * @return $this + */ + public function setIntentV2($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * @return string + */ + public function getIntent() + { + return $this->whichOneof("intent"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php new file mode 100644 index 000000000000..916e50e6b7db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php @@ -0,0 +1,56 @@ +google.cloud.dialogflow.v2.IntentView + */ +class IntentView +{ + /** + * Training phrases field is not populated in the response. + * + * Generated from protobuf enum INTENT_VIEW_UNSPECIFIED = 0; + */ + const INTENT_VIEW_UNSPECIFIED = 0; + /** + * All fields are populated. + * + * Generated from protobuf enum INTENT_VIEW_FULL = 1; + */ + const INTENT_VIEW_FULL = 1; + + private static $valueToName = [ + self::INTENT_VIEW_UNSPECIFIED => 'INTENT_VIEW_UNSPECIFIED', + self::INTENT_VIEW_FULL => 'INTENT_VIEW_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php new file mode 100644 index 000000000000..1bff7366c7ed --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php @@ -0,0 +1,215 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer + */ +class KnowledgeAssistAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + */ + protected $suggested_query = null; + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + */ + protected $suggested_query_answer = null; + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + */ + protected $answer_record = ''; + /** + * Debug information related to Knowledge Assist feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo knowledge_assist_debug_info = 7; + */ + protected $knowledge_assist_debug_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $suggested_query + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $suggested_query_answer + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * @type string $answer_record + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo $knowledge_assist_debug_info + * Debug information related to Knowledge Assist feature. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery|null + */ + public function getSuggestedQuery() + { + return $this->suggested_query; + } + + public function hasSuggestedQuery() + { + return isset($this->suggested_query); + } + + public function clearSuggestedQuery() + { + unset($this->suggested_query); + } + + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $var + * @return $this + */ + public function setSuggestedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery::class); + $this->suggested_query = $var; + + return $this; + } + + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer|null + */ + public function getSuggestedQueryAnswer() + { + return $this->suggested_query_answer; + } + + public function hasSuggestedQueryAnswer() + { + return isset($this->suggested_query_answer); + } + + public function clearSuggestedQueryAnswer() + { + unset($this->suggested_query_answer); + } + + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $var + * @return $this + */ + public function setSuggestedQueryAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer::class); + $this->suggested_query_answer = $var; + + return $this; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * Debug information related to Knowledge Assist feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo knowledge_assist_debug_info = 7; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo|null + */ + public function getKnowledgeAssistDebugInfo() + { + return $this->knowledge_assist_debug_info; + } + + public function hasKnowledgeAssistDebugInfo() + { + return isset($this->knowledge_assist_debug_info); + } + + public function clearKnowledgeAssistDebugInfo() + { + unset($this->knowledge_assist_debug_info); + } + + /** + * Debug information related to Knowledge Assist feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo knowledge_assist_debug_info = 7; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo $var + * @return $this + */ + public function setKnowledgeAssistDebugInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo::class); + $this->knowledge_assist_debug_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/AdditionalSuggestedQueryResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/AdditionalSuggestedQueryResult.php new file mode 100644 index 000000000000..eaf33fa38d1b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/AdditionalSuggestedQueryResult.php @@ -0,0 +1,119 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult + */ +class AdditionalSuggestedQueryResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The suggested query based on the context. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $suggested_query = null; + /** + * Output only. The name of the answer record. + * Format: `projects//locations//answerRecords/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $suggested_query + * Output only. The suggested query based on the context. + * @type string $answer_record + * Output only. The name of the answer record. + * Format: `projects//locations//answerRecords/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The suggested query based on the context. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery|null + */ + public function getSuggestedQuery() + { + return $this->suggested_query; + } + + public function hasSuggestedQuery() + { + return isset($this->suggested_query); + } + + public function clearSuggestedQuery() + { + unset($this->suggested_query); + } + + /** + * Output only. The suggested query based on the context. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $var + * @return $this + */ + public function setSuggestedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery::class); + $this->suggested_query = $var; + + return $this; + } + + /** + * Output only. The name of the answer record. + * Format: `projects//locations//answerRecords/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Output only. The name of the answer record. + * Format: `projects//locations//answerRecords/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php new file mode 100644 index 000000000000..2bfb100214d2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer + */ +class KnowledgeAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + */ + protected $answer_text = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_text + * The piece of text from the `source` that answers this suggested query. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $faq_source + * Populated if the prediction came from FAQ. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $generative_source + * Populated if the prediction was Generative. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $playbook_source + * Populated if the prediction was from Playbook. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\EventSource $event_source + * Populated if the prediction was from an event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + * @return string + */ + public function getAnswerText() + { + return $this->answer_text; + } + + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + * @param string $var + * @return $this + */ + public function setAnswerText($var) + { + GPBUtil::checkString($var, True); + $this->answer_text = $var; + + return $this; + } + + /** + * Populated if the prediction came from FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource|null + */ + public function getFaqSource() + { + return $this->readOneof(3); + } + + public function hasFaqSource() + { + return $this->hasOneof(3); + } + + /** + * Populated if the prediction came from FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $var + * @return $this + */ + public function setFaqSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Populated if the prediction was Generative. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource|null + */ + public function getGenerativeSource() + { + return $this->readOneof(4); + } + + public function hasGenerativeSource() + { + return $this->hasOneof(4); + } + + /** + * Populated if the prediction was Generative. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $var + * @return $this + */ + public function setGenerativeSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Populated if the prediction was from Playbook. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource playbook_source = 7; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource|null + */ + public function getPlaybookSource() + { + return $this->readOneof(7); + } + + public function hasPlaybookSource() + { + return $this->hasOneof(7); + } + + /** + * Populated if the prediction was from Playbook. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource playbook_source = 7; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $var + * @return $this + */ + public function setPlaybookSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Populated if the prediction was from an event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSource event_source = 8; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\EventSource|null + */ + public function getEventSource() + { + return $this->readOneof(8); + } + + public function hasEventSource() + { + return $this->hasOneof(8); + } + + /** + * Populated if the prediction was from an event. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSource event_source = 8; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\EventSource $var + * @return $this + */ + public function setEventSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\EventSource::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/EventSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/EventSource.php new file mode 100644 index 000000000000..b206946afa85 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/EventSource.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSource + */ +class EventSource extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the triggered event. + * + * Generated from protobuf field string event = 1; + */ + protected $event = ''; + /** + * Sources used in event fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource snippets = 2; + */ + protected $snippets = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $event + * Name of the triggered event. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $snippets + * Sources used in event fulfillment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Name of the triggered event. + * + * Generated from protobuf field string event = 1; + * @return string + */ + public function getEvent() + { + return $this->event; + } + + /** + * Name of the triggered event. + * + * Generated from protobuf field string event = 1; + * @param string $var + * @return $this + */ + public function setEvent($var) + { + GPBUtil::checkString($var, True); + $this->event = $var; + + return $this; + } + + /** + * Sources used in event fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource snippets = 2; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource|null + */ + public function getSnippets() + { + return $this->snippets; + } + + public function hasSnippets() + { + return isset($this->snippets); + } + + public function clearSnippets() + { + unset($this->snippets); + } + + /** + * Sources used in event fulfillment. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource snippets = 2; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $var + * @return $this + */ + public function setSnippets($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource::class); + $this->snippets = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php new file mode 100644 index 000000000000..2e95c35f5605 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource + */ +class FaqSource extends \Google\Protobuf\Internal\Message +{ + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + */ + protected $question = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * The corresponding FAQ question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php new file mode 100644 index 000000000000..4079f2a8c6d2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource + */ +class GenerativeSource extends \Google\Protobuf\Internal\Message +{ + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + */ + private $snippets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet[] $snippets + * All snippets used for this Generative Prediction, with their source URI + * and data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet> + */ + public function getSnippets() + { + return $this->snippets; + } + + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet[] $var + * @return $this + */ + public function setSnippets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet::class); + $this->snippets = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php new file mode 100644 index 000000000000..e32b51d699fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php @@ -0,0 +1,179 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet + */ +class Snippet extends \Google\Protobuf\Internal\Message +{ + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + */ + protected $text = ''; + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + */ + protected $title = ''; + /** + * Metadata of the document. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * URI the data is sourced from. + * @type string $text + * Text taken from that URI. + * @type string $title + * Title of the document. + * @type \Google\Protobuf\Struct $metadata + * Metadata of the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Metadata of the document. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Metadata of the document. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php new file mode 100644 index 000000000000..60bc907e00f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery + */ +class SuggestedQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + */ + protected $query_text = ''; + /** + * Optional. The search contexts for the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext search_contexts = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $search_contexts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_text + * Suggested query text. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery\SearchContext[] $search_contexts + * Optional. The search contexts for the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + * @return string + */ + public function getQueryText() + { + return $this->query_text; + } + + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + * @param string $var + * @return $this + */ + public function setQueryText($var) + { + GPBUtil::checkString($var, True); + $this->query_text = $var; + + return $this; + } + + /** + * Optional. The search contexts for the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext search_contexts = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery\SearchContext> + */ + public function getSearchContexts() + { + return $this->search_contexts; + } + + /** + * Optional. The search contexts for the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext search_contexts = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery\SearchContext[] $var + * @return $this + */ + public function setSearchContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery\SearchContext::class); + $this->search_contexts = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery/SearchContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery/SearchContext.php new file mode 100644 index 000000000000..7eaced5f821e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery/SearchContext.php @@ -0,0 +1,107 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext + */ +class SearchContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The key of the search context, e.g. "application name". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = ''; + /** + * Optional. The value of the search context, e.g. "DesignApp". + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. The key of the search context, e.g. "application name". + * @type string $value + * Optional. The value of the search context, e.g. "DesignApp". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The key of the search context, e.g. "application name". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Optional. The key of the search context, e.g. "application name". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. The value of the search context, e.g. "DesignApp". + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The value of the search context, e.g. "DesignApp". + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo.php new file mode 100644 index 000000000000..6d4082751c5c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo.php @@ -0,0 +1,359 @@ +google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo + */ +class KnowledgeAssistDebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Reason for query generation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason query_generation_failure_reason = 1; + */ + protected $query_generation_failure_reason = 0; + /** + * Reason for query categorization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason query_categorization_failure_reason = 2; + */ + protected $query_categorization_failure_reason = 0; + /** + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DatastoreResponseReason datastore_response_reason = 3; + */ + protected $datastore_response_reason = 0; + /** + * Configured behaviors for Knowedge Assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior knowledge_assist_behavior = 4; + */ + protected $knowledge_assist_behavior = null; + /** + * Information about parameters ingested for search knowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo ingested_context_reference_debug_info = 5; + */ + protected $ingested_context_reference_debug_info = null; + /** + * The latency of the service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ServiceLatency service_latency = 6; + */ + protected $service_latency = null; + /** + * Token usage metadata for query generation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo query_generation_debug_info = 7; + */ + protected $query_generation_debug_info = null; + /** + * Debug information from CES runtime API. + * + * Generated from protobuf field .google.protobuf.Struct ces_debug_info = 8; + */ + protected $ces_debug_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $query_generation_failure_reason + * Reason for query generation. + * @type int $query_categorization_failure_reason + * Reason for query categorization. + * @type int $datastore_response_reason + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\KnowledgeAssistBehavior $knowledge_assist_behavior + * Configured behaviors for Knowedge Assist. + * @type \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo $ingested_context_reference_debug_info + * Information about parameters ingested for search knowledge. + * @type \Google\Cloud\Dialogflow\V2\ServiceLatency $service_latency + * The latency of the service. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\QueryGenerationDebugInfo $query_generation_debug_info + * Token usage metadata for query generation. + * @type \Google\Protobuf\Struct $ces_debug_info + * Debug information from CES runtime API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Reason for query generation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason query_generation_failure_reason = 1; + * @return int + */ + public function getQueryGenerationFailureReason() + { + return $this->query_generation_failure_reason; + } + + /** + * Reason for query generation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason query_generation_failure_reason = 1; + * @param int $var + * @return $this + */ + public function setQueryGenerationFailureReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\QueryGenerationFailureReason::class); + $this->query_generation_failure_reason = $var; + + return $this; + } + + /** + * Reason for query categorization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason query_categorization_failure_reason = 2; + * @return int + */ + public function getQueryCategorizationFailureReason() + { + return $this->query_categorization_failure_reason; + } + + /** + * Reason for query categorization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason query_categorization_failure_reason = 2; + * @param int $var + * @return $this + */ + public function setQueryCategorizationFailureReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\QueryCategorizationFailureReason::class); + $this->query_categorization_failure_reason = $var; + + return $this; + } + + /** + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DatastoreResponseReason datastore_response_reason = 3; + * @return int + */ + public function getDatastoreResponseReason() + { + return $this->datastore_response_reason; + } + + /** + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DatastoreResponseReason datastore_response_reason = 3; + * @param int $var + * @return $this + */ + public function setDatastoreResponseReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\DatastoreResponseReason::class); + $this->datastore_response_reason = $var; + + return $this; + } + + /** + * Configured behaviors for Knowedge Assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior knowledge_assist_behavior = 4; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\KnowledgeAssistBehavior|null + */ + public function getKnowledgeAssistBehavior() + { + return $this->knowledge_assist_behavior; + } + + public function hasKnowledgeAssistBehavior() + { + return isset($this->knowledge_assist_behavior); + } + + public function clearKnowledgeAssistBehavior() + { + unset($this->knowledge_assist_behavior); + } + + /** + * Configured behaviors for Knowedge Assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior knowledge_assist_behavior = 4; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\KnowledgeAssistBehavior $var + * @return $this + */ + public function setKnowledgeAssistBehavior($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\KnowledgeAssistBehavior::class); + $this->knowledge_assist_behavior = $var; + + return $this; + } + + /** + * Information about parameters ingested for search knowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo ingested_context_reference_debug_info = 5; + * @return \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo|null + */ + public function getIngestedContextReferenceDebugInfo() + { + return $this->ingested_context_reference_debug_info; + } + + public function hasIngestedContextReferenceDebugInfo() + { + return isset($this->ingested_context_reference_debug_info); + } + + public function clearIngestedContextReferenceDebugInfo() + { + unset($this->ingested_context_reference_debug_info); + } + + /** + * Information about parameters ingested for search knowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo ingested_context_reference_debug_info = 5; + * @param \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo $var + * @return $this + */ + public function setIngestedContextReferenceDebugInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo::class); + $this->ingested_context_reference_debug_info = $var; + + return $this; + } + + /** + * The latency of the service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ServiceLatency service_latency = 6; + * @return \Google\Cloud\Dialogflow\V2\ServiceLatency|null + */ + public function getServiceLatency() + { + return $this->service_latency; + } + + public function hasServiceLatency() + { + return isset($this->service_latency); + } + + public function clearServiceLatency() + { + unset($this->service_latency); + } + + /** + * The latency of the service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ServiceLatency service_latency = 6; + * @param \Google\Cloud\Dialogflow\V2\ServiceLatency $var + * @return $this + */ + public function setServiceLatency($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ServiceLatency::class); + $this->service_latency = $var; + + return $this; + } + + /** + * Token usage metadata for query generation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo query_generation_debug_info = 7; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\QueryGenerationDebugInfo|null + */ + public function getQueryGenerationDebugInfo() + { + return $this->query_generation_debug_info; + } + + public function hasQueryGenerationDebugInfo() + { + return isset($this->query_generation_debug_info); + } + + public function clearQueryGenerationDebugInfo() + { + unset($this->query_generation_debug_info); + } + + /** + * Token usage metadata for query generation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo query_generation_debug_info = 7; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\QueryGenerationDebugInfo $var + * @return $this + */ + public function setQueryGenerationDebugInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo\QueryGenerationDebugInfo::class); + $this->query_generation_debug_info = $var; + + return $this; + } + + /** + * Debug information from CES runtime API. + * + * Generated from protobuf field .google.protobuf.Struct ces_debug_info = 8; + * @return \Google\Protobuf\Struct|null + */ + public function getCesDebugInfo() + { + return $this->ces_debug_info; + } + + public function hasCesDebugInfo() + { + return isset($this->ces_debug_info); + } + + public function clearCesDebugInfo() + { + unset($this->ces_debug_info); + } + + /** + * Debug information from CES runtime API. + * + * Generated from protobuf field .google.protobuf.Struct ces_debug_info = 8; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCesDebugInfo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->ces_debug_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/KnowledgeAssistBehavior.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/KnowledgeAssistBehavior.php new file mode 100644 index 000000000000..4db44da15b6e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/KnowledgeAssistBehavior.php @@ -0,0 +1,639 @@ +google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior + */ +class KnowledgeAssistBehavior extends \Google\Protobuf\Internal\Message +{ + /** + * Whether data store agent rewriter was turned off for the request. + * + * Generated from protobuf field bool answer_generation_rewriter_on = 1; + */ + protected $answer_generation_rewriter_on = false; + /** + * Whether end_user_metadata is included in the data store agent call. + * + * Generated from protobuf field bool end_user_metadata_included = 2; + */ + protected $end_user_metadata_included = false; + /** + * Whether customers configured to return query only in the + * conversation profile. + * + * Generated from protobuf field bool return_query_only = 4; + */ + protected $return_query_only = false; + /** + * Whether customers configured to use pubsub to deliver. + * + * Generated from protobuf field bool use_pubsub_delivery = 5; + */ + protected $use_pubsub_delivery = false; + /** + * Whether customers configured to disable the synchronous delivery of + * Knowedge Assist response. + * + * Generated from protobuf field bool disable_sync_delivery = 6; + */ + protected $disable_sync_delivery = false; + /** + * Whether previously suggested queries are included in the query generation + * process. + * + * Generated from protobuf field bool previous_queries_included = 7; + */ + protected $previous_queries_included = false; + /** + * Translated message is included in query generation process. + * + * Generated from protobuf field bool use_translated_message = 8; + */ + protected $use_translated_message = false; + /** + * Safety filter is adjusted by user. + * + * Generated from protobuf field bool use_custom_safety_filter_level = 9; + */ + protected $use_custom_safety_filter_level = false; + /** + * Conversation transcript has mixed languages. + * + * Generated from protobuf field bool conversation_transcript_has_mixed_languages = 10; + */ + protected $conversation_transcript_has_mixed_languages = false; + /** + * Whether the agent language from the translation generator mismatches the + * end-user language. + * + * Generated from protobuf field bool query_generation_agent_language_mismatch = 11; + */ + protected $query_generation_agent_language_mismatch = false; + /** + * Whether the end-user language from the translation generator mismatches + * the end-user language. + * + * Generated from protobuf field bool query_generation_end_user_language_mismatch = 12; + */ + protected $query_generation_end_user_language_mismatch = false; + /** + * This field indicates whether third party connectors are enabled for the + * project + * + * Generated from protobuf field bool third_party_connector_allowed = 13; + */ + protected $third_party_connector_allowed = false; + /** + * Indicates that the query generation model generated multiple queries. + * + * Generated from protobuf field bool multiple_queries_generated = 14; + */ + protected $multiple_queries_generated = false; + /** + * Indicates that the generated query contains search context. + * + * Generated from protobuf field bool query_contained_search_context = 15; + */ + protected $query_contained_search_context = false; + /** + * Indicates that invalid items were skipped when parsing the LLM response. + * + * Generated from protobuf field bool invalid_items_query_suggestion_skipped = 16; + */ + protected $invalid_items_query_suggestion_skipped = false; + /** + * True if the primary suggested query was redacted and replaced by an + * additional query. + * + * Generated from protobuf field bool primary_query_redacted_and_replaced = 17; + */ + protected $primary_query_redacted_and_replaced = false; + /** + * The number of search contexts appended to the query. + * + * Generated from protobuf field int32 appended_search_context_count = 18; + */ + protected $appended_search_context_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_generation_rewriter_on + * Whether data store agent rewriter was turned off for the request. + * @type bool $end_user_metadata_included + * Whether end_user_metadata is included in the data store agent call. + * @type bool $return_query_only + * Whether customers configured to return query only in the + * conversation profile. + * @type bool $use_pubsub_delivery + * Whether customers configured to use pubsub to deliver. + * @type bool $disable_sync_delivery + * Whether customers configured to disable the synchronous delivery of + * Knowedge Assist response. + * @type bool $previous_queries_included + * Whether previously suggested queries are included in the query generation + * process. + * @type bool $use_translated_message + * Translated message is included in query generation process. + * @type bool $use_custom_safety_filter_level + * Safety filter is adjusted by user. + * @type bool $conversation_transcript_has_mixed_languages + * Conversation transcript has mixed languages. + * @type bool $query_generation_agent_language_mismatch + * Whether the agent language from the translation generator mismatches the + * end-user language. + * @type bool $query_generation_end_user_language_mismatch + * Whether the end-user language from the translation generator mismatches + * the end-user language. + * @type bool $third_party_connector_allowed + * This field indicates whether third party connectors are enabled for the + * project + * @type bool $multiple_queries_generated + * Indicates that the query generation model generated multiple queries. + * @type bool $query_contained_search_context + * Indicates that the generated query contains search context. + * @type bool $invalid_items_query_suggestion_skipped + * Indicates that invalid items were skipped when parsing the LLM response. + * @type bool $primary_query_redacted_and_replaced + * True if the primary suggested query was redacted and replaced by an + * additional query. + * @type int $appended_search_context_count + * The number of search contexts appended to the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Whether data store agent rewriter was turned off for the request. + * + * Generated from protobuf field bool answer_generation_rewriter_on = 1; + * @return bool + */ + public function getAnswerGenerationRewriterOn() + { + return $this->answer_generation_rewriter_on; + } + + /** + * Whether data store agent rewriter was turned off for the request. + * + * Generated from protobuf field bool answer_generation_rewriter_on = 1; + * @param bool $var + * @return $this + */ + public function setAnswerGenerationRewriterOn($var) + { + GPBUtil::checkBool($var); + $this->answer_generation_rewriter_on = $var; + + return $this; + } + + /** + * Whether end_user_metadata is included in the data store agent call. + * + * Generated from protobuf field bool end_user_metadata_included = 2; + * @return bool + */ + public function getEndUserMetadataIncluded() + { + return $this->end_user_metadata_included; + } + + /** + * Whether end_user_metadata is included in the data store agent call. + * + * Generated from protobuf field bool end_user_metadata_included = 2; + * @param bool $var + * @return $this + */ + public function setEndUserMetadataIncluded($var) + { + GPBUtil::checkBool($var); + $this->end_user_metadata_included = $var; + + return $this; + } + + /** + * Whether customers configured to return query only in the + * conversation profile. + * + * Generated from protobuf field bool return_query_only = 4; + * @return bool + */ + public function getReturnQueryOnly() + { + return $this->return_query_only; + } + + /** + * Whether customers configured to return query only in the + * conversation profile. + * + * Generated from protobuf field bool return_query_only = 4; + * @param bool $var + * @return $this + */ + public function setReturnQueryOnly($var) + { + GPBUtil::checkBool($var); + $this->return_query_only = $var; + + return $this; + } + + /** + * Whether customers configured to use pubsub to deliver. + * + * Generated from protobuf field bool use_pubsub_delivery = 5; + * @return bool + */ + public function getUsePubsubDelivery() + { + return $this->use_pubsub_delivery; + } + + /** + * Whether customers configured to use pubsub to deliver. + * + * Generated from protobuf field bool use_pubsub_delivery = 5; + * @param bool $var + * @return $this + */ + public function setUsePubsubDelivery($var) + { + GPBUtil::checkBool($var); + $this->use_pubsub_delivery = $var; + + return $this; + } + + /** + * Whether customers configured to disable the synchronous delivery of + * Knowedge Assist response. + * + * Generated from protobuf field bool disable_sync_delivery = 6; + * @return bool + */ + public function getDisableSyncDelivery() + { + return $this->disable_sync_delivery; + } + + /** + * Whether customers configured to disable the synchronous delivery of + * Knowedge Assist response. + * + * Generated from protobuf field bool disable_sync_delivery = 6; + * @param bool $var + * @return $this + */ + public function setDisableSyncDelivery($var) + { + GPBUtil::checkBool($var); + $this->disable_sync_delivery = $var; + + return $this; + } + + /** + * Whether previously suggested queries are included in the query generation + * process. + * + * Generated from protobuf field bool previous_queries_included = 7; + * @return bool + */ + public function getPreviousQueriesIncluded() + { + return $this->previous_queries_included; + } + + /** + * Whether previously suggested queries are included in the query generation + * process. + * + * Generated from protobuf field bool previous_queries_included = 7; + * @param bool $var + * @return $this + */ + public function setPreviousQueriesIncluded($var) + { + GPBUtil::checkBool($var); + $this->previous_queries_included = $var; + + return $this; + } + + /** + * Translated message is included in query generation process. + * + * Generated from protobuf field bool use_translated_message = 8; + * @return bool + */ + public function getUseTranslatedMessage() + { + return $this->use_translated_message; + } + + /** + * Translated message is included in query generation process. + * + * Generated from protobuf field bool use_translated_message = 8; + * @param bool $var + * @return $this + */ + public function setUseTranslatedMessage($var) + { + GPBUtil::checkBool($var); + $this->use_translated_message = $var; + + return $this; + } + + /** + * Safety filter is adjusted by user. + * + * Generated from protobuf field bool use_custom_safety_filter_level = 9; + * @return bool + */ + public function getUseCustomSafetyFilterLevel() + { + return $this->use_custom_safety_filter_level; + } + + /** + * Safety filter is adjusted by user. + * + * Generated from protobuf field bool use_custom_safety_filter_level = 9; + * @param bool $var + * @return $this + */ + public function setUseCustomSafetyFilterLevel($var) + { + GPBUtil::checkBool($var); + $this->use_custom_safety_filter_level = $var; + + return $this; + } + + /** + * Conversation transcript has mixed languages. + * + * Generated from protobuf field bool conversation_transcript_has_mixed_languages = 10; + * @return bool + */ + public function getConversationTranscriptHasMixedLanguages() + { + return $this->conversation_transcript_has_mixed_languages; + } + + /** + * Conversation transcript has mixed languages. + * + * Generated from protobuf field bool conversation_transcript_has_mixed_languages = 10; + * @param bool $var + * @return $this + */ + public function setConversationTranscriptHasMixedLanguages($var) + { + GPBUtil::checkBool($var); + $this->conversation_transcript_has_mixed_languages = $var; + + return $this; + } + + /** + * Whether the agent language from the translation generator mismatches the + * end-user language. + * + * Generated from protobuf field bool query_generation_agent_language_mismatch = 11; + * @return bool + */ + public function getQueryGenerationAgentLanguageMismatch() + { + return $this->query_generation_agent_language_mismatch; + } + + /** + * Whether the agent language from the translation generator mismatches the + * end-user language. + * + * Generated from protobuf field bool query_generation_agent_language_mismatch = 11; + * @param bool $var + * @return $this + */ + public function setQueryGenerationAgentLanguageMismatch($var) + { + GPBUtil::checkBool($var); + $this->query_generation_agent_language_mismatch = $var; + + return $this; + } + + /** + * Whether the end-user language from the translation generator mismatches + * the end-user language. + * + * Generated from protobuf field bool query_generation_end_user_language_mismatch = 12; + * @return bool + */ + public function getQueryGenerationEndUserLanguageMismatch() + { + return $this->query_generation_end_user_language_mismatch; + } + + /** + * Whether the end-user language from the translation generator mismatches + * the end-user language. + * + * Generated from protobuf field bool query_generation_end_user_language_mismatch = 12; + * @param bool $var + * @return $this + */ + public function setQueryGenerationEndUserLanguageMismatch($var) + { + GPBUtil::checkBool($var); + $this->query_generation_end_user_language_mismatch = $var; + + return $this; + } + + /** + * This field indicates whether third party connectors are enabled for the + * project + * + * Generated from protobuf field bool third_party_connector_allowed = 13; + * @return bool + */ + public function getThirdPartyConnectorAllowed() + { + return $this->third_party_connector_allowed; + } + + /** + * This field indicates whether third party connectors are enabled for the + * project + * + * Generated from protobuf field bool third_party_connector_allowed = 13; + * @param bool $var + * @return $this + */ + public function setThirdPartyConnectorAllowed($var) + { + GPBUtil::checkBool($var); + $this->third_party_connector_allowed = $var; + + return $this; + } + + /** + * Indicates that the query generation model generated multiple queries. + * + * Generated from protobuf field bool multiple_queries_generated = 14; + * @return bool + */ + public function getMultipleQueriesGenerated() + { + return $this->multiple_queries_generated; + } + + /** + * Indicates that the query generation model generated multiple queries. + * + * Generated from protobuf field bool multiple_queries_generated = 14; + * @param bool $var + * @return $this + */ + public function setMultipleQueriesGenerated($var) + { + GPBUtil::checkBool($var); + $this->multiple_queries_generated = $var; + + return $this; + } + + /** + * Indicates that the generated query contains search context. + * + * Generated from protobuf field bool query_contained_search_context = 15; + * @return bool + */ + public function getQueryContainedSearchContext() + { + return $this->query_contained_search_context; + } + + /** + * Indicates that the generated query contains search context. + * + * Generated from protobuf field bool query_contained_search_context = 15; + * @param bool $var + * @return $this + */ + public function setQueryContainedSearchContext($var) + { + GPBUtil::checkBool($var); + $this->query_contained_search_context = $var; + + return $this; + } + + /** + * Indicates that invalid items were skipped when parsing the LLM response. + * + * Generated from protobuf field bool invalid_items_query_suggestion_skipped = 16; + * @return bool + */ + public function getInvalidItemsQuerySuggestionSkipped() + { + return $this->invalid_items_query_suggestion_skipped; + } + + /** + * Indicates that invalid items were skipped when parsing the LLM response. + * + * Generated from protobuf field bool invalid_items_query_suggestion_skipped = 16; + * @param bool $var + * @return $this + */ + public function setInvalidItemsQuerySuggestionSkipped($var) + { + GPBUtil::checkBool($var); + $this->invalid_items_query_suggestion_skipped = $var; + + return $this; + } + + /** + * True if the primary suggested query was redacted and replaced by an + * additional query. + * + * Generated from protobuf field bool primary_query_redacted_and_replaced = 17; + * @return bool + */ + public function getPrimaryQueryRedactedAndReplaced() + { + return $this->primary_query_redacted_and_replaced; + } + + /** + * True if the primary suggested query was redacted and replaced by an + * additional query. + * + * Generated from protobuf field bool primary_query_redacted_and_replaced = 17; + * @param bool $var + * @return $this + */ + public function setPrimaryQueryRedactedAndReplaced($var) + { + GPBUtil::checkBool($var); + $this->primary_query_redacted_and_replaced = $var; + + return $this; + } + + /** + * The number of search contexts appended to the query. + * + * Generated from protobuf field int32 appended_search_context_count = 18; + * @return int + */ + public function getAppendedSearchContextCount() + { + return $this->appended_search_context_count; + } + + /** + * The number of search contexts appended to the query. + * + * Generated from protobuf field int32 appended_search_context_count = 18; + * @param int $var + * @return $this + */ + public function setAppendedSearchContextCount($var) + { + GPBUtil::checkInt32($var); + $this->appended_search_context_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryCategorizationFailureReason.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryCategorizationFailureReason.php new file mode 100644 index 000000000000..2892e3fe9111 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryCategorizationFailureReason.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason + */ +class QueryCategorizationFailureReason +{ + /** + * Default value. + * + * Generated from protobuf enum QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0; + */ + const QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0; + /** + * Vertex AI Search config supplied for query categorization is invalid. + * + * Generated from protobuf enum QUERY_CATEGORIZATION_INVALID_CONFIG = 1; + */ + const QUERY_CATEGORIZATION_INVALID_CONFIG = 1; + /** + * Vertex AI Search result does not contain a query categorization result. + * + * Generated from protobuf enum QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2; + */ + const QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2; + /** + * Vertex AI Search call fails. + * + * Generated from protobuf enum QUERY_CATEGORIZATION_FAILED = 3; + */ + const QUERY_CATEGORIZATION_FAILED = 3; + + private static $valueToName = [ + self::QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED => 'QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED', + self::QUERY_CATEGORIZATION_INVALID_CONFIG => 'QUERY_CATEGORIZATION_INVALID_CONFIG', + self::QUERY_CATEGORIZATION_RESULT_NOT_FOUND => 'QUERY_CATEGORIZATION_RESULT_NOT_FOUND', + self::QUERY_CATEGORIZATION_FAILED => 'QUERY_CATEGORIZATION_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationDebugInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationDebugInfo.php new file mode 100644 index 000000000000..d54b2f34d127 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationDebugInfo.php @@ -0,0 +1,135 @@ +google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo + */ +class QueryGenerationDebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The total number of tokens in the prompt. + * + * Generated from protobuf field int32 prompt_token_count = 1; + */ + protected $prompt_token_count = 0; + /** + * The total number of tokens in the generated candidates. + * + * Generated from protobuf field int32 candidates_token_count = 2; + */ + protected $candidates_token_count = 0; + /** + * The total number of tokens for the entire request. + * + * Generated from protobuf field int32 total_token_count = 3; + */ + protected $total_token_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $prompt_token_count + * The total number of tokens in the prompt. + * @type int $candidates_token_count + * The total number of tokens in the generated candidates. + * @type int $total_token_count + * The total number of tokens for the entire request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The total number of tokens in the prompt. + * + * Generated from protobuf field int32 prompt_token_count = 1; + * @return int + */ + public function getPromptTokenCount() + { + return $this->prompt_token_count; + } + + /** + * The total number of tokens in the prompt. + * + * Generated from protobuf field int32 prompt_token_count = 1; + * @param int $var + * @return $this + */ + public function setPromptTokenCount($var) + { + GPBUtil::checkInt32($var); + $this->prompt_token_count = $var; + + return $this; + } + + /** + * The total number of tokens in the generated candidates. + * + * Generated from protobuf field int32 candidates_token_count = 2; + * @return int + */ + public function getCandidatesTokenCount() + { + return $this->candidates_token_count; + } + + /** + * The total number of tokens in the generated candidates. + * + * Generated from protobuf field int32 candidates_token_count = 2; + * @param int $var + * @return $this + */ + public function setCandidatesTokenCount($var) + { + GPBUtil::checkInt32($var); + $this->candidates_token_count = $var; + + return $this; + } + + /** + * The total number of tokens for the entire request. + * + * Generated from protobuf field int32 total_token_count = 3; + * @return int + */ + public function getTotalTokenCount() + { + return $this->total_token_count; + } + + /** + * The total number of tokens for the entire request. + * + * Generated from protobuf field int32 total_token_count = 3; + * @param int $var + * @return $this + */ + public function setTotalTokenCount($var) + { + GPBUtil::checkInt32($var); + $this->total_token_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationFailureReason.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationFailureReason.php new file mode 100644 index 000000000000..3426ef67c4c9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistDebugInfo/QueryGenerationFailureReason.php @@ -0,0 +1,124 @@ +google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason + */ +class QueryGenerationFailureReason +{ + /** + * Default value. + * + * Generated from protobuf enum QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0; + */ + const QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0; + /** + * Query generation is blocked due to out of quota. + * + * Generated from protobuf enum QUERY_GENERATION_OUT_OF_QUOTA = 1; + */ + const QUERY_GENERATION_OUT_OF_QUOTA = 1; + /** + * Call to Knowedge Assist query generation model fails. + * + * Generated from protobuf enum QUERY_GENERATION_FAILED = 2; + */ + const QUERY_GENERATION_FAILED = 2; + /** + * Query generation model decides that there is no new topic change or + * there has been similar queries generated in the previous turns. + * + * Generated from protobuf enum QUERY_GENERATION_NO_QUERY_GENERATED = 3; + */ + const QUERY_GENERATION_NO_QUERY_GENERATED = 3; + /** + * Knowedge Assist generated query is blocked by RAI (Responsible AI). + * + * Generated from protobuf enum QUERY_GENERATION_RAI_FAILED = 4; + */ + const QUERY_GENERATION_RAI_FAILED = 4; + /** + * Query generation is blocked by Knowledge Assist conversation profile + * level / agent id level filtering. + * + * Generated from protobuf enum NOT_IN_ALLOWLIST = 5; + */ + const NOT_IN_ALLOWLIST = 5; + /** + * The generated query is blocked due to redaction. + * + * Generated from protobuf enum QUERY_GENERATION_QUERY_REDACTED = 6; + */ + const QUERY_GENERATION_QUERY_REDACTED = 6; + /** + * Query generation failed due to LLM response parse failure. + * + * Generated from protobuf enum QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10; + */ + const QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10; + /** + * The conversation has no messages. + * + * Generated from protobuf enum QUERY_GENERATION_EMPTY_CONVERSATION = 11; + */ + const QUERY_GENERATION_EMPTY_CONVERSATION = 11; + /** + * The last message in the conversation is empty. + * + * Generated from protobuf enum QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12; + */ + const QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12; + /** + * The trigger event condition is not met. + * This occurs in the following scenarios: + * 1. The trigger_event is CUSTOMER_MESSAGE or UNSPECIFIED, but the last + * message is not from the customer. + * 2. The trigger_event is AGENT_MESSAGE, but the last message is not from + * the agent. + * + * Generated from protobuf enum QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13; + */ + const QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13; + + private static $valueToName = [ + self::QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED => 'QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED', + self::QUERY_GENERATION_OUT_OF_QUOTA => 'QUERY_GENERATION_OUT_OF_QUOTA', + self::QUERY_GENERATION_FAILED => 'QUERY_GENERATION_FAILED', + self::QUERY_GENERATION_NO_QUERY_GENERATED => 'QUERY_GENERATION_NO_QUERY_GENERATED', + self::QUERY_GENERATION_RAI_FAILED => 'QUERY_GENERATION_RAI_FAILED', + self::NOT_IN_ALLOWLIST => 'NOT_IN_ALLOWLIST', + self::QUERY_GENERATION_QUERY_REDACTED => 'QUERY_GENERATION_QUERY_REDACTED', + self::QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED => 'QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED', + self::QUERY_GENERATION_EMPTY_CONVERSATION => 'QUERY_GENERATION_EMPTY_CONVERSATION', + self::QUERY_GENERATION_EMPTY_LAST_MESSAGE => 'QUERY_GENERATION_EMPTY_LAST_MESSAGE', + self::QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET => 'QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php new file mode 100644 index 000000000000..0de5f2cb750d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php @@ -0,0 +1,166 @@ +google.cloud.dialogflow.v2.KnowledgeBase + */ +class KnowledgeBase extends \Google\Protobuf\Internal\Message +{ + /** + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * + * Generated from protobuf field string language_code = 4; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * @type string $display_name + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * @type string $language_code + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The knowledge base resource name. + * The name must be empty when creating a knowledge base. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * + * Generated from protobuf field string language_code = 4; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language which represents the KnowledgeBase. When the KnowledgeBase is + * created/updated, expect this to be present for non en-us languages. When + * unspecified, the default language code en-us applies. + * + * Generated from protobuf field string language_code = 4; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php new file mode 100644 index 000000000000..b2002a648604 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php @@ -0,0 +1,187 @@ +google.cloud.dialogflow.v2.KnowledgeOperationMetadata + */ +class KnowledgeOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of this operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The name of the knowledge base interacted with during the operation. + * + * Generated from protobuf field string knowledge_base = 3; + */ + protected $knowledge_base = ''; + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 5; + */ + protected $done_time = null; + protected $operation_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. The current state of this operation. + * @type string $knowledge_base + * The name of the knowledge base interacted with during the operation. + * @type \Google\Cloud\Dialogflow\V2\ExportOperationMetadata $export_operation_metadata + * Metadata for the Export Data Operation such as the destination of export. + * @type \Google\Protobuf\Timestamp $done_time + * The time when the operation finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of this operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of this operation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * The name of the knowledge base interacted with during the operation. + * + * Generated from protobuf field string knowledge_base = 3; + * @return string + */ + public function getKnowledgeBase() + { + return $this->knowledge_base; + } + + /** + * The name of the knowledge base interacted with during the operation. + * + * Generated from protobuf field string knowledge_base = 3; + * @param string $var + * @return $this + */ + public function setKnowledgeBase($var) + { + GPBUtil::checkString($var, True); + $this->knowledge_base = $var; + + return $this; + } + + /** + * Metadata for the Export Data Operation such as the destination of export. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ExportOperationMetadata export_operation_metadata = 4; + * @return \Google\Cloud\Dialogflow\V2\ExportOperationMetadata|null + */ + public function getExportOperationMetadata() + { + return $this->readOneof(4); + } + + public function hasExportOperationMetadata() + { + return $this->hasOneof(4); + } + + /** + * Metadata for the Export Data Operation such as the destination of export. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ExportOperationMetadata export_operation_metadata = 4; + * @param \Google\Cloud\Dialogflow\V2\ExportOperationMetadata $var + * @return $this + */ + public function setExportOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ExportOperationMetadata::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDoneTime() + { + return $this->done_time; + } + + public function hasDoneTime() + { + return isset($this->done_time); + } + + public function clearDoneTime() + { + unset($this->done_time); + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDoneTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->done_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getOperationMetadata() + { + return $this->whichOneof("operation_metadata"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php new file mode 100644 index 000000000000..d7f5f2f9c29b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State + */ +class State +{ + /** + * State unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The operation has been created. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The operation is currently running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The operation is done, either cancelled or completed. + * + * Generated from protobuf enum DONE = 3; + */ + const DONE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + self::DONE => 'DONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php new file mode 100644 index 000000000000..eea15b5b0fa3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php @@ -0,0 +1,254 @@ +google.cloud.dialogflow.v2.ListAnswerRecordsRequest + */ +class ListAnswerRecordsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. Please see + * {@see AnswerRecordsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListAnswerRecordsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @type string $filter + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type int $page_size + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * @type string $page_token + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filters to restrict results to specific answer records. The + * expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * conversation_id with equals(=) operator + * Examples: + * * `conversation_id=bar` matches answer records in the + * `projects/foo/locations/global/conversations/bar` conversation + * (assuming the parent is `projects/foo/locations/global`). + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of records to return in a single page. + * The server may return fewer records than this. If unspecified, we use 10. + * The maximum is 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The + * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * value returned from a previous list request used to continue listing on + * the next page. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsResponse.php new file mode 100644 index 000000000000..75e0453b968e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsResponse.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.ListAnswerRecordsResponse + */ +class ListAnswerRecordsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of answer records. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnswerRecord answer_records = 1; + */ + private $answer_records; + /** + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AnswerRecord[] $answer_records + * The list of answer records. + * @type string $next_page_token + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * The list of answer records. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnswerRecord answer_records = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AnswerRecord> + */ + public function getAnswerRecords() + { + return $this->answer_records; + } + + /** + * The list of answer records. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnswerRecord answer_records = 1; + * @param \Google\Cloud\Dialogflow\V2\AnswerRecord[] $var + * @return $this + */ + public function setAnswerRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AnswerRecord::class); + $this->answer_records = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. Or empty if there are no more + * results. + * Pass this value in the + * [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + * field in the subsequent call to `ListAnswerRecords` method to retrieve the + * next page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsRequest.php new file mode 100644 index 000000000000..165aa98a638b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsRequest.php @@ -0,0 +1,179 @@ +google.cloud.dialogflow.v2.ListContextsRequest + */ +class ListContextsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListContextsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsResponse.php new file mode 100644 index 000000000000..f91f6ee0f0e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListContextsResponse + */ +class ListContextsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 1; + */ + private $contexts; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Context[] $contexts + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Context> + */ + public function getContexts() + { + return $this->contexts; + } + + /** + * The list of contexts. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 1; + * @param \Google\Cloud\Dialogflow\V2\Context[] $var + * @return $this + */ + public function setContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->contexts = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsRequest.php new file mode 100644 index 000000000000..93af0cc5d7d5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.ListConversationDatasetsRequest + */ +class ListConversationDatasetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * Please see {@see ConversationDatasetsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationDatasetsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * @type int $page_size + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation datasets to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsResponse.php new file mode 100644 index 000000000000..5ef250a62725 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListConversationDatasetsResponse + */ +class ListConversationDatasetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of datasets to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationDataset conversation_datasets = 1; + */ + private $conversation_datasets; + /** + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationDataset[] $conversation_datasets + * The list of datasets to return. + * @type string $next_page_token + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * The list of datasets to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationDataset conversation_datasets = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ConversationDataset> + */ + public function getConversationDatasets() + { + return $this->conversation_datasets; + } + + /** + * The list of datasets to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationDataset conversation_datasets = 1; + * @param \Google\Cloud\Dialogflow\V2\ConversationDataset[] $var + * @return $this + */ + public function setConversationDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationDataset::class); + $this->conversation_datasets = $arr; + + return $this; + } + + /** + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to use to retrieve the next page of results, or empty if there + * are no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsRequest.php new file mode 100644 index 000000000000..c5a0c09693a6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest + */ +class ListConversationModelEvaluationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationModelEvaluationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * @type int $page_size + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsResponse.php new file mode 100644 index 000000000000..be972bd0a6fe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse + */ +class ListConversationModelEvaluationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluations = 1; + */ + private $conversation_model_evaluations; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation[] $conversation_model_evaluations + * The list of evaluations to return. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluations = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation> + */ + public function getConversationModelEvaluations() + { + return $this->conversation_model_evaluations; + } + + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModelEvaluation conversation_model_evaluations = 1; + * @param \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation[] $var + * @return $this + */ + public function setConversationModelEvaluations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation::class); + $this->conversation_model_evaluations = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsRequest.php new file mode 100644 index 000000000000..63604e70a534 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListConversationModelsRequest + */ +class ListConversationModelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list all conversation models for. + * Format: `projects/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list all conversation models for. + * Format: `projects/` + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationModelsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list all conversation models for. + * Format: `projects/` + * @type int $page_size + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list all conversation models for. + * Format: `projects/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list all conversation models for. + * Format: `projects/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation models to return in a single + * page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsResponse.php new file mode 100644 index 000000000000..a90076dbf537 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListConversationModelsResponse + */ +class ListConversationModelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of models to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModel conversation_models = 1; + */ + private $conversation_models; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationModel[] $conversation_models + * The list of models to return. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The list of models to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModel conversation_models = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ConversationModel> + */ + public function getConversationModels() + { + return $this->conversation_models; + } + + /** + * The list of models to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationModel conversation_models = 1; + * @param \Google\Cloud\Dialogflow\V2\ConversationModel[] $var + * @return $this + */ + public function setConversationModels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationModel::class); + $this->conversation_models = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesRequest.php new file mode 100644 index 000000000000..c6a08398bc6d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.ListConversationProfilesRequest + */ +class ListConversationProfilesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationProfilesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @type int $page_size + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesResponse.php new file mode 100644 index 000000000000..e7bc51d3710b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListConversationProfilesResponse + */ +class ListConversationProfilesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationProfile conversation_profiles = 1; + */ + private $conversation_profiles; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile[] $conversation_profiles + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationProfile conversation_profiles = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ConversationProfile> + */ + public function getConversationProfiles() + { + return $this->conversation_profiles; + } + + /** + * The list of project conversation profiles. There is a maximum number + * of items returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ConversationProfile conversation_profiles = 1; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile[] $var + * @return $this + */ + public function setConversationProfiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profiles = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php new file mode 100644 index 000000000000..3393c3717d85 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php @@ -0,0 +1,213 @@ +google.cloud.dialogflow.v2.ListConversationsRequest + */ +class ListConversationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project from which to list all conversation. + * Format: `projects//locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * @type string $filter + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php new file mode 100644 index 000000000000..c9bdd5c09a9d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListConversationsResponse + */ +class ListConversationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation conversations = 1; + */ + private $conversations; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Conversation[] $conversations + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation conversations = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Conversation> + */ + public function getConversations() + { + return $this->conversations; + } + + /** + * The list of conversations. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Conversation conversations = 1; + * @param \Google\Cloud\Dialogflow\V2\Conversation[] $var + * @return $this + */ + public function setConversations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Conversation::class); + $this->conversations = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsRequest.php new file mode 100644 index 000000000000..8c099ab584d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsRequest.php @@ -0,0 +1,254 @@ +google.cloud.dialogflow.v2.ListDocumentsRequest + */ +class ListDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListDocumentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @type int $page_size + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * @type string $filter + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter expression used to filter documents returned by the list method. + * The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * knowledge_types with has(:) operator + * * display_name with has(:) operator + * * state with equals(=) operator + * Examples: + * * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + * * "display_name:customer" matches documents whose display name contains + * "customer". + * * "state=ACTIVE" matches documents with ACTIVE state. + * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsResponse.php new file mode 100644 index 000000000000..9f8050f6e771 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListDocumentsResponse + */ +class ListDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + */ + private $documents; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Document[] $documents + * The list of documents. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Document> + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + * @param \Google\Cloud\Dialogflow\V2\Document[] $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Document::class); + $this->documents = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesRequest.php new file mode 100644 index 000000000000..0b41194fb68a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesRequest.php @@ -0,0 +1,230 @@ +google.cloud.dialogflow.v2.ListEntityTypesRequest + */ +class ListEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all entity types from. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListEntityTypesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * @param string $parent Required. The agent to list all entity types from. + * Format: `projects//agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\ListEntityTypesRequest + * + * @experimental + */ + public static function buildFromParentLanguageCode(string $parent, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all entity types from. + * Format: `projects//agent`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesResponse.php new file mode 100644 index 000000000000..63cdcb815665 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListEntityTypesResponse + */ +class ListEntityTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + */ + private $entity_types; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EntityType[] $entity_types + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType> + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType entity_types = 1; + * @param \Google\Cloud\Dialogflow\V2\EntityType[] $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsRequest.php new file mode 100644 index 000000000000..664982a5ae9a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsRequest.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.ListEnvironmentsRequest + */ +class ListEnvironmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all environments from. + * Format: + * + * - `projects//agent` + * - `projects//locations//agent` + * Please see {@see EnvironmentsClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListEnvironmentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsResponse.php new file mode 100644 index 000000000000..ce932964a133 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListEnvironmentsResponse + */ +class ListEnvironmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Environment environments = 1; + */ + private $environments; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Environment[] $environments + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Environment environments = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Environment> + */ + public function getEnvironments() + { + return $this->environments; + } + + /** + * The list of agent environments. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Environment environments = 1; + * @param \Google\Cloud\Dialogflow\V2\Environment[] $var + * @return $this + */ + public function setEnvironments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Environment::class); + $this->environments = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsRequest.php new file mode 100644 index 000000000000..feede743cc3b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsRequest.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.ListGeneratorEvaluationsRequest + */ +class ListGeneratorEvaluationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * Wildcard value `-` is supported on generator_id to list evaluations across + * all generators under same project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The generator resource name. Format: + * `projects//locations//generators/` + * Wildcard value `-` is supported on generator_id to list evaluations across + * all generators under same project. Please see + * {@see GeneratorEvaluationsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListGeneratorEvaluationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * Wildcard value `-` is supported on generator_id to list evaluations across + * all generators under same project. + * @type int $page_size + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * Wildcard value `-` is supported on generator_id to list evaluations across + * all generators under same project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The generator resource name. Format: + * `projects//locations//generators/` + * Wildcard value `-` is supported on generator_id to list evaluations across + * all generators under same project. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of evaluations to return in a + * single page. By default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsResponse.php new file mode 100644 index 000000000000..42c8773681f7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorEvaluationsResponse.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ListGeneratorEvaluationsResponse + */ +class ListGeneratorEvaluationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GeneratorEvaluation generator_evaluations = 1; + */ + private $generator_evaluations; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorEvaluation[] $generator_evaluations + * The list of evaluations to return. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GeneratorEvaluation generator_evaluations = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\GeneratorEvaluation> + */ + public function getGeneratorEvaluations() + { + return $this->generator_evaluations; + } + + /** + * The list of evaluations to return. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.GeneratorEvaluation generator_evaluations = 1; + * @param \Google\Cloud\Dialogflow\V2\GeneratorEvaluation[] $var + * @return $this + */ + public function setGeneratorEvaluations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\GeneratorEvaluation::class); + $this->generator_evaluations = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php new file mode 100644 index 000000000000..e80841e653ee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListGeneratorsRequest + */ +class ListGeneratorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project/location to list generators for. Format: + * `projects//locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListGeneratorsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * @type int $page_size + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php new file mode 100644 index 000000000000..cdf840846020 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ListGeneratorsResponse + */ +class ListGeneratorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + */ + private $generators; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Generator[] $generators + * List of generators retrieved. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Generator> + */ + public function getGenerators() + { + return $this->generators; + } + + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + * @param \Google\Cloud\Dialogflow\V2\Generator[] $var + * @return $this + */ + public function setGenerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generators = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php new file mode 100644 index 000000000000..e44a75896247 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php @@ -0,0 +1,308 @@ +google.cloud.dialogflow.v2.ListIntentsRequest + */ +class ListIntentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListIntentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * @param string $parent Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\ListIntentsRequest + * + * @experimental + */ + public static function buildFromParentLanguageCode(string $parent, string $languageCode): self + { + return (new self()) + ->setParent($parent) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all intents from. + * Format: `projects//agent` or `projects//locations//agent`. + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php new file mode 100644 index 000000000000..0e73eade42b0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListIntentsResponse + */ +class ListIntentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + */ + private $intents; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent[] $intents + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent> + */ + public function getIntents() + { + return $this->intents; + } + + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param \Google\Cloud\Dialogflow\V2\Intent[] $var + * @return $this + */ + public function setIntents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intents = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php new file mode 100644 index 000000000000..3966b9486db0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php @@ -0,0 +1,265 @@ +google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + */ +class ListKnowledgeBasesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListKnowledgeBasesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @type int $page_size + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * @type string $filter + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter expression used to filter knowledge bases returned by the list + * method. The expression has the following syntax: + * [AND ] ... + * The following fields and operators are supported: + * * display_name with has(:) operator + * * language_code with equals(=) operator + * Examples: + * * 'language_code=en-us' matches knowledge bases with en-us language code. + * * 'display_name:articles' matches knowledge bases whose display name + * contains "articles". + * * 'display_name:"Best Articles"' matches knowledge bases whose display + * name contains "Best Articles". + * * 'language_code=en-gb AND display_name=articles' matches all knowledge + * bases whose display name contains "articles" and whose language code is + * "en-gb". + * Note: An empty filter string (i.e. "") is a no-op and will result in no + * filtering. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php new file mode 100644 index 000000000000..d84de795e204 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + */ +class ListKnowledgeBasesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of knowledge bases. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeBase knowledge_bases = 1; + */ + private $knowledge_bases; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeBase[] $knowledge_bases + * The list of knowledge bases. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * The list of knowledge bases. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeBase knowledge_bases = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\KnowledgeBase> + */ + public function getKnowledgeBases() + { + return $this->knowledge_bases; + } + + /** + * The list of knowledge bases. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeBase knowledge_bases = 1; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase[] $var + * @return $this + */ + public function setKnowledgeBases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeBase::class); + $this->knowledge_bases = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php new file mode 100644 index 000000000000..bec2970f819b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php @@ -0,0 +1,222 @@ +google.cloud.dialogflow.v2.ListMessagesRequest + */ +class ListMessagesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * Please see {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListMessagesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @type string $filter + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter on message fields. Currently predicates on `create_time` + * and `create_time_epoch_microseconds` are supported. `create_time` only + * support milliseconds accuracy. E.g., + * `create_time_epoch_microseconds > 1551790877964485` or + * `create_time > 2017-01-15T01:30:15.01Z`. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php new file mode 100644 index 000000000000..85b93f568f0c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php @@ -0,0 +1,114 @@ +google.cloud.dialogflow.v2.ListMessagesResponse + */ +class ListMessagesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1; + */ + private $messages; + /** + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Message[] $messages + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Message> + */ + public function getMessages() + { + return $this->messages; + } + + /** + * The list of messages. There will be a maximum number of items + * returned based on the page_size field in the request. + * `messages` is sorted by `create_time` in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Message messages = 1; + * @param \Google\Cloud\Dialogflow\V2\Message[] $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are + * no more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php new file mode 100644 index 000000000000..4f8b2dface84 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php @@ -0,0 +1,164 @@ +google.cloud.dialogflow.v2.ListParticipantsRequest + */ +class ListParticipantsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListParticipantsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php new file mode 100644 index 000000000000..af13ed3921ec --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListParticipantsResponse + */ +class ListParticipantsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Participant participants = 1; + */ + private $participants; + /** + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Participant[] $participants + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Participant participants = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Participant> + */ + public function getParticipants() + { + return $this->participants; + } + + /** + * The list of participants. There is a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Participant participants = 1; + * @param \Google\Cloud\Dialogflow\V2\Participant[] $var + * @return $this + */ + public function setParticipants($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Participant::class); + $this->participants = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php new file mode 100644 index 000000000000..0797594d4909 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php @@ -0,0 +1,179 @@ +google.cloud.dialogflow.v2.ListSessionEntityTypesRequest + */ +class ListSessionEntityTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListSessionEntityTypesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The session to list all session entity types from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php new file mode 100644 index 000000000000..f4e2dc1a5447 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListSessionEntityTypesResponse + */ +class ListSessionEntityTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 1; + */ + private $session_entity_types; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType[] $session_entity_types + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SessionEntityType> + */ + public function getSessionEntityTypes() + { + return $this->session_entity_types; + } + + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 1; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType[] $var + * @return $this + */ + public function setSessionEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_types = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksRequest.php new file mode 100644 index 000000000000..e439207a5999 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.ListSipTrunksRequest + */ +class ListSipTrunksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location to list SIP trunks from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The location to list SIP trunks from. + * Format: `projects//locations/`. Please see + * {@see SipTrunksClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListSipTrunksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location to list SIP trunks from. + * Format: `projects//locations/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location to list SIP trunks from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location to list SIP trunks from. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksResponse.php new file mode 100644 index 000000000000..38c8796e1b0a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSipTrunksResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.ListSipTrunksResponse + */ +class ListSipTrunksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SIP trunks. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SipTrunk sip_trunks = 1; + */ + private $sip_trunks; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SipTrunk[] $sip_trunks + * The list of SIP trunks. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * The list of SIP trunks. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SipTrunk sip_trunks = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SipTrunk> + */ + public function getSipTrunks() + { + return $this->sip_trunks; + } + + /** + * The list of SIP trunks. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SipTrunk sip_trunks = 1; + * @param \Google\Cloud\Dialogflow\V2\SipTrunk[] $var + * @return $this + */ + public function setSipTrunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SipTrunk::class); + $this->sip_trunks = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsRequest.php new file mode 100644 index 000000000000..276fc05579ef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListToolsRequest + */ +class ListToolsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to list tools for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project/location to list tools for. Format: + * `projects//locations/` + * Please see {@see ToolsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListToolsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to list tools for. Format: + * `projects//locations/` + * @type int $page_size + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to list tools for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to list tools for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsResponse.php new file mode 100644 index 000000000000..a5f344a20fbe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListToolsResponse.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ListToolsResponse + */ +class ListToolsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of tools retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool tools = 1; + */ + private $tools; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Tool[] $tools + * List of tools retrieved. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * List of tools retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool tools = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Tool> + */ + public function getTools() + { + return $this->tools; + } + + /** + * List of tools retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool tools = 1; + * @param \Google\Cloud\Dialogflow\V2\Tool[] $var + * @return $this + */ + public function setTools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Tool::class); + $this->tools = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php new file mode 100644 index 000000000000..a4ecf3c8ff78 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.ListVersionsRequest + */ +class ListVersionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The agent to list all versions from. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListVersionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php new file mode 100644 index 000000000000..19bb9f741927 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.ListVersionsResponse + */ +class ListVersionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Version versions = 1; + */ + private $versions; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Version[] $versions + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Version versions = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Version> + */ + public function getVersions() + { + return $this->versions; + } + + /** + * The list of agent versions. There will be a maximum number of items + * returned based on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Version versions = 1; + * @param \Google\Cloud\Dialogflow\V2\Version[] $var + * @return $this + */ + public function setVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Version::class); + $this->versions = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php new file mode 100644 index 000000000000..a5061a6714a3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php @@ -0,0 +1,79 @@ +google.cloud.dialogflow.v2.LoggingConfig + */ +class LoggingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * + * Generated from protobuf field bool enable_stackdriver_logging = 3; + */ + protected $enable_stackdriver_logging = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_stackdriver_logging + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * + * Generated from protobuf field bool enable_stackdriver_logging = 3; + * @return bool + */ + public function getEnableStackdriverLogging() + { + return $this->enable_stackdriver_logging; + } + + /** + * Whether to log conversation events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * to Stackdriver in the conversation project as JSON format + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * + * Generated from protobuf field bool enable_stackdriver_logging = 3; + * @param bool $var + * @return $this + */ + public function setEnableStackdriverLogging($var) + { + GPBUtil::checkBool($var); + $this->enable_stackdriver_logging = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php new file mode 100644 index 000000000000..973c3af823ca --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php @@ -0,0 +1,399 @@ +google.cloud.dialogflow.v2.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Required. The message content. + * + * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $content = ''; + /** + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Output only. The participant that sends this message. + * + * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $participant = ''; + /** + * Output only. The role of the participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $participant_role = 0; + /** + * Output only. The time when the message was created in Contact Center AI. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $send_time = null; + /** + * Output only. The annotation for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $message_annotation = null; + /** + * Output only. The sentiment analysis result for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sentiment_analysis = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * @type string $content + * Required. The message content. + * @type string $language_code + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * @type string $participant + * Output only. The participant that sends this message. + * @type int $participant_role + * Output only. The role of the participant. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the message was created in Contact Center AI. + * @type \Google\Protobuf\Timestamp $send_time + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * @type \Google\Cloud\Dialogflow\V2\MessageAnnotation $message_annotation + * Output only. The annotation for the message. + * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $sentiment_analysis + * Output only. The sentiment analysis result for the message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The unique identifier of the message. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The message content. + * + * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Required. The message content. + * + * Generated from protobuf field string content = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The message language. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Output only. The participant that sends this message. + * + * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Output only. The participant that sends this message. + * + * Generated from protobuf field string participant = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * Output only. The role of the participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Output only. The role of the participant. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Output only. The time when the message was created in Contact Center AI. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the message was created in Contact Center AI. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSendTime() + { + return $this->send_time; + } + + public function hasSendTime() + { + return isset($this->send_time); + } + + public function clearSendTime() + { + unset($this->send_time); + } + + /** + * Optional. The time when the message was sent. For voice messages, this is + * the time when an utterance started. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSendTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->send_time = $var; + + return $this; + } + + /** + * Output only. The annotation for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\MessageAnnotation|null + */ + public function getMessageAnnotation() + { + return $this->message_annotation; + } + + public function hasMessageAnnotation() + { + return isset($this->message_annotation); + } + + public function clearMessageAnnotation() + { + unset($this->message_annotation); + } + + /** + * Output only. The annotation for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageAnnotation message_annotation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\MessageAnnotation $var + * @return $this + */ + public function setMessageAnnotation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\MessageAnnotation::class); + $this->message_annotation = $var; + + return $this; + } + + /** + * Output only. The sentiment analysis result for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult|null + */ + public function getSentimentAnalysis() + { + return $this->sentiment_analysis; + } + + public function hasSentimentAnalysis() + { + return isset($this->sentiment_analysis); + } + + public function clearSentimentAnalysis() + { + unset($this->sentiment_analysis); + } + + /** + * Output only. The sentiment analysis result for the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $var + * @return $this + */ + public function setSentimentAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult::class); + $this->sentiment_analysis = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php new file mode 100644 index 000000000000..874a8f7bb3c7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php @@ -0,0 +1,109 @@ +google.cloud.dialogflow.v2.MessageAnnotation + */ +class MessageAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnnotatedMessagePart parts = 1; + */ + private $parts; + /** + * Indicates whether the text message contains entities. + * + * Generated from protobuf field bool contain_entities = 2; + */ + protected $contain_entities = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AnnotatedMessagePart[] $parts + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * @type bool $contain_entities + * Indicates whether the text message contains entities. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnnotatedMessagePart parts = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart> + */ + public function getParts() + { + return $this->parts; + } + + /** + * The collection of annotated message parts ordered by their + * position in the message. You can recover the annotated message by + * concatenating [AnnotatedMessagePart.text]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.AnnotatedMessagePart parts = 1; + * @param \Google\Cloud\Dialogflow\V2\AnnotatedMessagePart[] $var + * @return $this + */ + public function setParts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\AnnotatedMessagePart::class); + $this->parts = $arr; + + return $this; + } + + /** + * Indicates whether the text message contains entities. + * + * Generated from protobuf field bool contain_entities = 2; + * @return bool + */ + public function getContainEntities() + { + return $this->contain_entities; + } + + /** + * Indicates whether the text message contains entities. + * + * Generated from protobuf field bool contain_entities = 2; + * @param bool $var + * @return $this + */ + public function setContainEntities($var) + { + GPBUtil::checkBool($var); + $this->contain_entities = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php new file mode 100644 index 000000000000..d987c4cc8222 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php @@ -0,0 +1,187 @@ +google.cloud.dialogflow.v2.MessageEntry + */ +class MessageEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $role = 0; + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $role + * Optional. Participant role of the message. + * @type string $text + * Optional. Transcript content of the message. + * @type string $language_code + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Create time of the message entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRole() + { + return $this->role; + } + + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\MessageEntry\Role::class); + $this->role = $var; + + return $this; + } + + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php new file mode 100644 index 000000000000..0221eb4e3821 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.MessageEntry.Role + */ +class Role +{ + /** + * Participant role not set. + * + * Generated from protobuf enum ROLE_UNSPECIFIED = 0; + */ + const ROLE_UNSPECIFIED = 0; + /** + * Participant is a human agent. + * + * Generated from protobuf enum HUMAN_AGENT = 1; + */ + const HUMAN_AGENT = 1; + /** + * Participant is an automated agent, such as a Dialogflow agent. + * + * Generated from protobuf enum AUTOMATED_AGENT = 2; + */ + const AUTOMATED_AGENT = 2; + /** + * Participant is an end user that has called or chatted with + * Dialogflow services. + * + * Generated from protobuf enum END_USER = 3; + */ + const END_USER = 3; + + private static $valueToName = [ + self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', + self::HUMAN_AGENT => 'HUMAN_AGENT', + self::AUTOMATED_AGENT => 'AUTOMATED_AGENT', + self::END_USER => 'END_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php new file mode 100644 index 000000000000..b4e9fc409813 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php @@ -0,0 +1,149 @@ +google.cloud.dialogflow.v2.NotificationConfig + */ +class NotificationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * + * Generated from protobuf field string topic = 1; + */ + protected $topic = ''; + /** + * Format of message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig.MessageFormat message_format = 2; + */ + protected $message_format = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * @type int $message_format + * Format of message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * + * Generated from protobuf field string topic = 1; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Name of the Pub/Sub topic to publish conversation + * events like + * [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] + * as serialized + * [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + * For telephony integration to receive notification, make sure either this + * topic is in the same project as the conversation or you grant + * `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + * Agent` role in the topic project. + * For chat integration to receive notification, make sure API caller has been + * granted the `Dialogflow Service Agent` role for the topic. + * Format: `projects//locations//topics/`. + * + * Generated from protobuf field string topic = 1; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Format of message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig.MessageFormat message_format = 2; + * @return int + */ + public function getMessageFormat() + { + return $this->message_format; + } + + /** + * Format of message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.NotificationConfig.MessageFormat message_format = 2; + * @param int $var + * @return $this + */ + public function setMessageFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\NotificationConfig\MessageFormat::class); + $this->message_format = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php new file mode 100644 index 000000000000..c1a83d059f9b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.NotificationConfig.MessageFormat + */ +class MessageFormat +{ + /** + * If it is unspecified, PROTO will be used. + * + * Generated from protobuf enum MESSAGE_FORMAT_UNSPECIFIED = 0; + */ + const MESSAGE_FORMAT_UNSPECIFIED = 0; + /** + * Pub/Sub message will be serialized proto. + * + * Generated from protobuf enum PROTO = 1; + */ + const PROTO = 1; + /** + * Pub/Sub message will be json. + * + * Generated from protobuf enum JSON = 2; + */ + const JSON = 2; + + private static $valueToName = [ + self::MESSAGE_FORMAT_UNSPECIFIED => 'MESSAGE_FORMAT_UNSPECIFIED', + self::PROTO => 'PROTO', + self::JSON => 'JSON', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php new file mode 100644 index 000000000000..2fccf3fe68b5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php @@ -0,0 +1,202 @@ +google.cloud.dialogflow.v2.OriginalDetectIntentRequest + */ +class OriginalDetectIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * + * Generated from protobuf field string source = 1; + */ + protected $source = ''; + /** + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *  "telephony": {
+     *    "caller_id": "+18558363987"
+     *  }
+     * }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * + * Generated from protobuf field .google.protobuf.Struct payload = 3; + */ + protected $payload = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * @type string $version + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * @type \Google\Protobuf\Struct $payload + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *            "telephony": {
+     *              "caller_id": "+18558363987"
+     *            }
+     *           }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Webhook::initOnce(); + parent::__construct($data); + } + + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * + * Generated from protobuf field string source = 1; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is set + * by Dialogflow-owned servers. + * + * Generated from protobuf field string source = 1; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. The version of the protocol used for this request. + * This field is AoG-specific. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *  "telephony": {
+     *    "caller_id": "+18558363987"
+     *  }
+     * }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * + * Generated from protobuf field .google.protobuf.Struct payload = 3; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * Optional. This field is set to the value of the `QueryParameters.payload` + * field passed in the request. Some integrations that query a Dialogflow + * agent may provide additional information in the payload. + * In particular, for the Dialogflow Phone Gateway integration, this field has + * the form: + *
{
+     *  "telephony": {
+     *    "caller_id": "+18558363987"
+     *  }
+     * }
+ * Note: The caller ID field (`caller_id`) will be redacted for Trial + * Edition agents and populated with the caller ID in [E.164 + * format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + * + * Generated from protobuf field .google.protobuf.Struct payload = 3; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->payload = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php new file mode 100644 index 000000000000..4346bc50eb39 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php @@ -0,0 +1,115 @@ +google.cloud.dialogflow.v2.OutputAudio + */ +class OutputAudio extends \Google\Protobuf\Internal\Message +{ + /** + * Instructs the speech synthesizer how to generate the speech + * audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig config = 1; + */ + protected $config = null; + /** + * The natural language speech audio. + * + * Generated from protobuf field bytes audio = 2; + */ + protected $audio = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $config + * Instructs the speech synthesizer how to generate the speech + * audio. + * @type string $audio + * The natural language speech audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Instructs the speech synthesizer how to generate the speech + * audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig config = 1; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Instructs the speech synthesizer how to generate the speech + * audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig config = 1; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->config = $var; + + return $this; + } + + /** + * The natural language speech audio. + * + * Generated from protobuf field bytes audio = 2; + * @return string + */ + public function getAudio() + { + return $this->audio; + } + + /** + * The natural language speech audio. + * + * Generated from protobuf field bytes audio = 2; + * @param string $var + * @return $this + */ + public function setAudio($var) + { + GPBUtil::checkString($var, False); + $this->audio = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php new file mode 100644 index 000000000000..4d7e911e3bf7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php @@ -0,0 +1,163 @@ +google.cloud.dialogflow.v2.OutputAudioConfig + */ +class OutputAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 2; + */ + protected $sample_rate_hertz = 0; + /** + * Configuration of how speech should be synthesized. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig synthesize_speech_config = 3; + */ + protected $synthesize_speech_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. Audio encoding of the synthesized audio content. + * @type int $sample_rate_hertz + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * @type \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $synthesize_speech_config + * Configuration of how speech should be synthesized. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\OutputAudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 2; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 2; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Configuration of how speech should be synthesized. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig synthesize_speech_config = 3; + * @return \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig|null + */ + public function getSynthesizeSpeechConfig() + { + return $this->synthesize_speech_config; + } + + public function hasSynthesizeSpeechConfig() + { + return isset($this->synthesize_speech_config); + } + + public function clearSynthesizeSpeechConfig() + { + unset($this->synthesize_speech_config); + } + + /** + * Configuration of how speech should be synthesized. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SynthesizeSpeechConfig synthesize_speech_config = 3; + * @param \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig $var + * @return $this + */ + public function setSynthesizeSpeechConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig::class); + $this->synthesize_speech_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php new file mode 100644 index 000000000000..6a595974dd3d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php @@ -0,0 +1,93 @@ +google.cloud.dialogflow.v2.OutputAudioEncoding + */ +class OutputAudioEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Audio content returned as LINEAR16 also contains a WAV header. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + */ + const OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + /** + * MP3 audio at 64kbps. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MP3 = 2 [deprecated = true]; + */ + const OUTPUT_AUDIO_ENCODING_MP3 = 2; + /** + * MP3 audio at 64kbps. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + */ + const OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4; + /** + * Opus encoded audio wrapped in an ogg container. The result will be a + * file which can be played natively on Android, and in browsers (at least + * Chrome and Firefox). The quality of the encoding is considerably higher + * than MP3 while using approximately the same bitrate. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + */ + const OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MULAW = 5; + */ + const OUTPUT_AUDIO_ENCODING_MULAW = 5; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_ALAW = 6; + */ + const OUTPUT_AUDIO_ENCODING_ALAW = 6; + + private static $valueToName = [ + self::OUTPUT_AUDIO_ENCODING_UNSPECIFIED => 'OUTPUT_AUDIO_ENCODING_UNSPECIFIED', + self::OUTPUT_AUDIO_ENCODING_LINEAR_16 => 'OUTPUT_AUDIO_ENCODING_LINEAR_16', + self::OUTPUT_AUDIO_ENCODING_MP3 => 'OUTPUT_AUDIO_ENCODING_MP3', + self::OUTPUT_AUDIO_ENCODING_MP3_64_KBPS => 'OUTPUT_AUDIO_ENCODING_MP3_64_KBPS', + self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS', + self::OUTPUT_AUDIO_ENCODING_MULAW => 'OUTPUT_AUDIO_ENCODING_MULAW', + self::OUTPUT_AUDIO_ENCODING_ALAW => 'OUTPUT_AUDIO_ENCODING_ALAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php new file mode 100644 index 000000000000..9cf967915b94 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php @@ -0,0 +1,473 @@ +google.cloud.dialogflow.v2.Participant + */ +class Participant extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role role = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $role = 0; + /** + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * + * Generated from protobuf field string sip_recording_media_label = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sip_recording_media_label = ''; + /** + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] + * or [StreamingAnalyzeContent] + * [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Additionally, to link an escalated Virtual Agent conversation + * with its corresponding Agent Assist conversation for analytics, this field + * in Agent Assist conversations should be populated to indicate the user id + * of the `END_USER` participant in the escalated conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * + * Generated from protobuf field string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $obfuscated_external_user_id = ''; + /** + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $documents_metadata_filters; + /** + * Optional. For tracking the utilization of prebuilt Agent Assist integration + * modules. This field is only inscope for Integration type that include UI + * Modules, Backend Modules, and Agent Desktop connector, it is out of scope + * for CCaaS and Direct Integration. + * For each human agent, prebuilt UI Modules needs to trigger the + * UpdateParticipant API to update this field. Both + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * and + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant] + * will be supported. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.AgentDesktopSource agent_desktop_source = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_desktop_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * @type int $role + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * @type string $sip_recording_media_label + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * @type string $obfuscated_external_user_id + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] + * or [StreamingAnalyzeContent] + * [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Additionally, to link an escalated Virtual Agent conversation + * with its corresponding Agent Assist conversation for analytics, this field + * in Agent Assist conversations should be populated to indicate the user id + * of the `END_USER` participant in the escalated conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * @type array|\Google\Protobuf\Internal\MapField $documents_metadata_filters + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * @type int $agent_desktop_source + * Optional. For tracking the utilization of prebuilt Agent Assist integration + * modules. This field is only inscope for Integration type that include UI + * Modules, Backend Modules, and Agent Desktop connector, it is out of scope + * for CCaaS and Direct Integration. + * For each human agent, prebuilt UI Modules needs to trigger the + * UpdateParticipant API to update this field. Both + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * and + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant] + * will be supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The unique identifier of this participant. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role role = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getRole() + { + return $this->role; + } + + /** + * Immutable. The role this participant plays in the conversation. This field + * must be set during participant creation and is then immutable. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role role = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->role = $var; + + return $this; + } + + /** + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * + * Generated from protobuf field string sip_recording_media_label = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSipRecordingMediaLabel() + { + return $this->sip_recording_media_label; + } + + /** + * Optional. Label applied to streams representing this participant in SIPREC + * XML metadata and SDP. This is used to assign transcriptions from that + * media stream to this participant. This field can be updated. + * + * Generated from protobuf field string sip_recording_media_label = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSipRecordingMediaLabel($var) + { + GPBUtil::checkString($var, True); + $this->sip_recording_media_label = $var; + + return $this; + } + + /** + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] + * or [StreamingAnalyzeContent] + * [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Additionally, to link an escalated Virtual Agent conversation + * with its corresponding Agent Assist conversation for analytics, this field + * in Agent Assist conversations should be populated to indicate the user id + * of the `END_USER` participant in the escalated conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * + * Generated from protobuf field string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getObfuscatedExternalUserId() + { + return $this->obfuscated_external_user_id; + } + + /** + * Optional. Obfuscated user id that should be associated with the created + * participant. + * You can specify a user id as follows: + * 1. If you set this field in + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * or + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + * Dialogflow adds the obfuscated user id with the participant. + * 2. If you set this field in + * [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] + * or [StreamingAnalyzeContent] + * [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + * Dialogflow will update + * [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + * Dialogflow returns an error if you try to add a user id for a + * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] + * participant. + * Dialogflow uses this user id for billing and measurement purposes. For + * example, Dialogflow determines whether a user in one conversation returned + * in a later conversation. + * Additionally, to link an escalated Virtual Agent conversation + * with its corresponding Agent Assist conversation for analytics, this field + * in Agent Assist conversations should be populated to indicate the user id + * of the `END_USER` participant in the escalated conversation. + * Note: + * * Please never pass raw user ids to Dialogflow. Always obfuscate your user + * id first. + * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + * hash function like SHA-512. + * * The length of the user id must be <= 256 characters. + * + * Generated from protobuf field string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setObfuscatedExternalUserId($var) + { + GPBUtil::checkString($var, True); + $this->obfuscated_external_user_id = $var; + + return $this; + } + + /** + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDocumentsMetadataFilters() + { + return $this->documents_metadata_filters; + } + + /** + * Optional. Key-value filters on the metadata of documents returned by + * article suggestion. If specified, article suggestion only returns suggested + * documents that match all filters in their + * [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple + * values for a metadata key should be concatenated by comma. For example, + * filters to match all documents that have 'US' or 'CA' in their market + * metadata values and 'agent' in their user metadata values will be + * ``` + * documents_metadata_filters { + * key: "market" + * value: "US,CA" + * } + * documents_metadata_filters { + * key: "user" + * value: "agent" + * } + * ``` + * + * Generated from protobuf field map documents_metadata_filters = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDocumentsMetadataFilters($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents_metadata_filters = $arr; + + return $this; + } + + /** + * Optional. For tracking the utilization of prebuilt Agent Assist integration + * modules. This field is only inscope for Integration type that include UI + * Modules, Backend Modules, and Agent Desktop connector, it is out of scope + * for CCaaS and Direct Integration. + * For each human agent, prebuilt UI Modules needs to trigger the + * UpdateParticipant API to update this field. Both + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * and + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant] + * will be supported. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.AgentDesktopSource agent_desktop_source = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAgentDesktopSource() + { + return $this->agent_desktop_source; + } + + /** + * Optional. For tracking the utilization of prebuilt Agent Assist integration + * modules. This field is only inscope for Integration type that include UI + * Modules, Backend Modules, and Agent Desktop connector, it is out of scope + * for CCaaS and Direct Integration. + * For each human agent, prebuilt UI Modules needs to trigger the + * UpdateParticipant API to update this field. Both + * [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] + * and + * [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant] + * will be supported. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.AgentDesktopSource agent_desktop_source = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAgentDesktopSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\AgentDesktopSource::class); + $this->agent_desktop_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/AgentDesktopSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/AgentDesktopSource.php new file mode 100644 index 000000000000..2ef37ee847d2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/AgentDesktopSource.php @@ -0,0 +1,84 @@ +google.cloud.dialogflow.v2.Participant.AgentDesktopSource + */ +class AgentDesktopSource +{ + /** + * Agent Desktop Source is not specified. + * + * Generated from protobuf enum AGENT_DESKTOP_SOURCE_UNSPECIFIED = 0; + */ + const AGENT_DESKTOP_SOURCE_UNSPECIFIED = 0; + /** + * Agent Desktop Source is Live Person. + * + * Generated from protobuf enum LIVE_PERSON = 1; + */ + const LIVE_PERSON = 1; + /** + * Agent Desktop Source is Genesys Cloud. + * + * Generated from protobuf enum GENESYS_CLOUD = 2; + */ + const GENESYS_CLOUD = 2; + /** + * Agent Desktop Source is Twilio. + * + * Generated from protobuf enum TWILIO = 3; + */ + const TWILIO = 3; + /** + * Agent Desktop Source is Salesforce. + * + * Generated from protobuf enum SALESFORCE = 4; + */ + const SALESFORCE = 4; + /** + * UI Modules are in use but the desktop is either not currently released or + * setting this field to the applicable desktop. + * + * Generated from protobuf enum OTHER = 8; + */ + const OTHER = 8; + + private static $valueToName = [ + self::AGENT_DESKTOP_SOURCE_UNSPECIFIED => 'AGENT_DESKTOP_SOURCE_UNSPECIFIED', + self::LIVE_PERSON => 'LIVE_PERSON', + self::GENESYS_CLOUD => 'GENESYS_CLOUD', + self::TWILIO => 'TWILIO', + self::SALESFORCE => 'SALESFORCE', + self::OTHER => 'OTHER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php new file mode 100644 index 000000000000..a01d3fcb1342 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.Participant.Role + */ +class Role +{ + /** + * Participant role not set. + * + * Generated from protobuf enum ROLE_UNSPECIFIED = 0; + */ + const ROLE_UNSPECIFIED = 0; + /** + * Participant is a human agent. + * + * Generated from protobuf enum HUMAN_AGENT = 1; + */ + const HUMAN_AGENT = 1; + /** + * Participant is an automated agent, such as a Dialogflow agent. + * + * Generated from protobuf enum AUTOMATED_AGENT = 2; + */ + const AUTOMATED_AGENT = 2; + /** + * Participant is an end user that has called or chatted with + * Dialogflow services. + * + * Generated from protobuf enum END_USER = 3; + */ + const END_USER = 3; + + private static $valueToName = [ + self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', + self::HUMAN_AGENT => 'HUMAN_AGENT', + self::AUTOMATED_AGENT => 'AUTOMATED_AGENT', + self::END_USER => 'END_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryInput.php new file mode 100644 index 000000000000..afbcee9a27f5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryInput.php @@ -0,0 +1,148 @@ +google.cloud.dialogflow.v2.QueryInput + */ +class QueryInput extends \Google\Protobuf\Internal\Message +{ + protected $input; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $audio_config + * Instructs the speech recognizer how to process the speech audio. + * @type \Google\Cloud\Dialogflow\V2\TextInput $text + * The natural language text to be processed. Text length must not exceed + * 256 character for virtual agent interactions. + * @type \Google\Cloud\Dialogflow\V2\EventInput $event + * The event to be processed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 1; + * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null + */ + public function getAudioConfig() + { + return $this->readOneof(1); + } + + public function hasAudioConfig() + { + return $this->hasOneof(1); + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 1; + * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The natural language text to be processed. Text length must not exceed + * 256 character for virtual agent interactions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text = 2; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getText() + { + return $this->readOneof(2); + } + + public function hasText() + { + return $this->hasOneof(2); + } + + /** + * The natural language text to be processed. Text length must not exceed + * 256 character for virtual agent interactions. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text = 2; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The event to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event = 3; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getEvent() + { + return $this->readOneof(3); + } + + public function hasEvent() + { + return $this->hasOneof(3); + } + + /** + * The event to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event = 3; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php new file mode 100644 index 000000000000..1e3c998b393c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php @@ -0,0 +1,461 @@ +google.cloud.dialogflow.v2.QueryParameters + */ +class QueryParameters extends \Google\Protobuf\Internal\Message +{ + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + */ + protected $time_zone = ''; + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + */ + protected $geo_location = null; + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + */ + private $contexts; + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + */ + protected $reset_contexts = false; + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + */ + private $session_entity_types; + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + */ + protected $payload = null; + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + */ + protected $sentiment_analysis_request_config = null; + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + */ + private $webhook_headers; + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + */ + protected $platform = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $time_zone + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * @type \Google\Type\LatLng $geo_location + * The geo location of this conversational query. + * @type \Google\Cloud\Dialogflow\V2\Context[] $contexts + * The collection of contexts to be activated before this query is + * executed. + * @type bool $reset_contexts + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType[] $session_entity_types + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * @type \Google\Protobuf\Struct $payload + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig $sentiment_analysis_request_config + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * @type array|\Google\Protobuf\Internal\MapField $webhook_headers + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * @type string $platform + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + * @return \Google\Type\LatLng|null + */ + public function getGeoLocation() + { + return $this->geo_location; + } + + public function hasGeoLocation() + { + return isset($this->geo_location); + } + + public function clearGeoLocation() + { + unset($this->geo_location); + } + + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setGeoLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->geo_location = $var; + + return $this; + } + + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Context> + */ + public function getContexts() + { + return $this->contexts; + } + + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + * @param \Google\Cloud\Dialogflow\V2\Context[] $var + * @return $this + */ + public function setContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->contexts = $arr; + + return $this; + } + + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + * @return bool + */ + public function getResetContexts() + { + return $this->reset_contexts; + } + + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + * @param bool $var + * @return $this + */ + public function setResetContexts($var) + { + GPBUtil::checkBool($var); + $this->reset_contexts = $var; + + return $this; + } + + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SessionEntityType> + */ + public function getSessionEntityTypes() + { + return $this->session_entity_types; + } + + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType[] $var + * @return $this + */ + public function setSessionEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_types = $arr; + + return $this; + } + + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->payload = $var; + + return $this; + } + + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig|null + */ + public function getSentimentAnalysisRequestConfig() + { + return $this->sentiment_analysis_request_config; + } + + public function hasSentimentAnalysisRequestConfig() + { + return isset($this->sentiment_analysis_request_config); + } + + public function clearSentimentAnalysisRequestConfig() + { + unset($this->sentiment_analysis_request_config); + } + + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig $var + * @return $this + */ + public function setSentimentAnalysisRequestConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisRequestConfig::class); + $this->sentiment_analysis_request_config = $var; + + return $this; + } + + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getWebhookHeaders() + { + return $this->webhook_headers; + } + + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setWebhookHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->webhook_headers = $arr; + + return $this; + } + + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + * @return string + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + * @param string $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkString($var, True); + $this->platform = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php new file mode 100644 index 000000000000..64a718431b65 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php @@ -0,0 +1,847 @@ +google.cloud.dialogflow.v2.QueryResult + */ +class QueryResult extends \Google\Protobuf\Internal\Message +{ + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + */ + protected $query_text = ''; + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + */ + protected $language_code = ''; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + */ + protected $speech_recognition_confidence = 0.0; + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + */ + protected $action = ''; + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + */ + protected $parameters = null; + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + */ + protected $all_required_params_present = false; + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + */ + protected $cancels_slot_filling = false; + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + */ + protected $fulfillment_text = ''; + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + */ + private $fulfillment_messages; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + */ + protected $webhook_source = ''; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + */ + protected $webhook_payload = null; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + */ + private $output_contexts; + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + */ + protected $intent = null; + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + */ + protected $intent_detection_confidence = 0.0; + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + */ + protected $diagnostic_info = null; + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + */ + protected $sentiment_analysis_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_text + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * @type string $language_code + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * @type float $speech_recognition_confidence + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * @type string $action + * The action name from the matched intent. + * @type \Google\Protobuf\Struct $parameters + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * @type bool $all_required_params_present + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * @type bool $cancels_slot_filling + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * @type string $fulfillment_text + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message[] $fulfillment_messages + * The collection of rich messages to present to the user. + * @type string $webhook_source + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * @type \Google\Protobuf\Struct $webhook_payload + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * @type \Google\Cloud\Dialogflow\V2\Context[] $output_contexts + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * @type \Google\Cloud\Dialogflow\V2\Intent $intent + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * @type float $intent_detection_confidence + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * @type \Google\Protobuf\Struct $diagnostic_info + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * @type \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $sentiment_analysis_result + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + * @return string + */ + public function getQueryText() + { + return $this->query_text; + } + + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + * @param string $var + * @return $this + */ + public function setQueryText($var) + { + GPBUtil::checkString($var, True); + $this->query_text = $var; + + return $this; + } + + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + * @return float + */ + public function getSpeechRecognitionConfidence() + { + return $this->speech_recognition_confidence; + } + + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for [StreamingDetectIntent][] since the streaming endpoint + * has separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + * @param float $var + * @return $this + */ + public function setSpeechRecognitionConfidence($var) + { + GPBUtil::checkFloat($var); + $this->speech_recognition_confidence = $var; + + return $this; + } + + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + * @return bool + */ + public function getAllRequiredParamsPresent() + { + return $this->all_required_params_present; + } + + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + * @param bool $var + * @return $this + */ + public function setAllRequiredParamsPresent($var) + { + GPBUtil::checkBool($var); + $this->all_required_params_present = $var; + + return $this; + } + + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + * @return bool + */ + public function getCancelsSlotFilling() + { + return $this->cancels_slot_filling; + } + + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + * @param bool $var + * @return $this + */ + public function setCancelsSlotFilling($var) + { + GPBUtil::checkBool($var); + $this->cancels_slot_filling = $var; + + return $this; + } + + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + * @return string + */ + public function getFulfillmentText() + { + return $this->fulfillment_text; + } + + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + * @param string $var + * @return $this + */ + public function setFulfillmentText($var) + { + GPBUtil::checkString($var, True); + $this->fulfillment_text = $var; + + return $this; + } + + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message> + */ + public function getFulfillmentMessages() + { + return $this->fulfillment_messages; + } + + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message[] $var + * @return $this + */ + public function setFulfillmentMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class); + $this->fulfillment_messages = $arr; + + return $this; + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + * @return string + */ + public function getWebhookSource() + { + return $this->webhook_source; + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + * @param string $var + * @return $this + */ + public function setWebhookSource($var) + { + GPBUtil::checkString($var, True); + $this->webhook_source = $var; + + return $this; + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + * @return \Google\Protobuf\Struct|null + */ + public function getWebhookPayload() + { + return $this->webhook_payload; + } + + public function hasWebhookPayload() + { + return isset($this->webhook_payload); + } + + public function clearWebhookPayload() + { + unset($this->webhook_payload); + } + + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setWebhookPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->webhook_payload = $var; + + return $this; + } + + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Context> + */ + public function getOutputContexts() + { + return $this->output_contexts; + } + + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + * @param \Google\Cloud\Dialogflow\V2\Context[] $var + * @return $this + */ + public function setOutputContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->output_contexts = $arr; + + return $this; + } + + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + * @return \Google\Cloud\Dialogflow\V2\Intent|null + */ + public function getIntent() + { + return $this->intent; + } + + public function hasIntent() + { + return isset($this->intent); + } + + public function clearIntent() + { + unset($this->intent); + } + + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + * @param \Google\Cloud\Dialogflow\V2\Intent $var + * @return $this + */ + public function setIntent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intent = $var; + + return $this; + } + + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + * @return float + */ + public function getIntentDetectionConfidence() + { + return $this->intent_detection_confidence; + } + + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + * @param float $var + * @return $this + */ + public function setIntentDetectionConfidence($var) + { + GPBUtil::checkFloat($var); + $this->intent_detection_confidence = $var; + + return $this; + } + + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + * @return \Google\Protobuf\Struct|null + */ + public function getDiagnosticInfo() + { + return $this->diagnostic_info; + } + + public function hasDiagnosticInfo() + { + return isset($this->diagnostic_info); + } + + public function clearDiagnosticInfo() + { + unset($this->diagnostic_info); + } + + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDiagnosticInfo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->diagnostic_info = $var; + + return $this; + } + + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + * @return \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult|null + */ + public function getSentimentAnalysisResult() + { + return $this->sentiment_analysis_result; + } + + public function hasSentimentAnalysisResult() + { + return isset($this->sentiment_analysis_result); + } + + public function clearSentimentAnalysisResult() + { + unset($this->sentiment_analysis_result); + } + + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + * @param \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult $var + * @return $this + */ + public function setSentimentAnalysisResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SentimentAnalysisResult::class); + $this->sentiment_analysis_result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings.php new file mode 100644 index 000000000000..280befb5ca19 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.RaiSettings + */ +class RaiSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Configuration for a set of RAI categories. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig rai_category_configs = 1; + */ + private $rai_category_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig[] $rai_category_configs + * Configuration for a set of RAI categories. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Configuration for a set of RAI categories. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig rai_category_configs = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig> + */ + public function getRaiCategoryConfigs() + { + return $this->rai_category_configs; + } + + /** + * Configuration for a set of RAI categories. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig rai_category_configs = 1; + * @param \Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig[] $var + * @return $this + */ + public function setRaiCategoryConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig::class); + $this->rai_category_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig.php new file mode 100644 index 000000000000..cdd4e6b0d142 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig + */ +class RaiCategoryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The RAI category. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory category = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $category = 0; + /** + * Optional. The sensitivity level for this category. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevel sensitivity_level = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sensitivity_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $category + * Optional. The RAI category. + * @type int $sensitivity_level + * Optional. The sensitivity level for this category. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The RAI category. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory category = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCategory() + { + return $this->category; + } + + /** + * Optional. The RAI category. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory category = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig\RaiCategory::class); + $this->category = $var; + + return $this; + } + + /** + * Optional. The sensitivity level for this category. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevel sensitivity_level = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSensitivityLevel() + { + return $this->sensitivity_level; + } + + /** + * Optional. The sensitivity level for this category. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevel sensitivity_level = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSensitivityLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig\SensitivityLevel::class); + $this->sensitivity_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/RaiCategory.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/RaiCategory.php new file mode 100644 index 000000000000..aac43aacc83e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/RaiCategory.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory + */ +class RaiCategory +{ + /** + * Default value. + * + * Generated from protobuf enum RAI_CATEGORY_UNSPECIFIED = 0; + */ + const RAI_CATEGORY_UNSPECIFIED = 0; + /** + * Dangerous content. + * + * Generated from protobuf enum DANGEROUS_CONTENT = 1; + */ + const DANGEROUS_CONTENT = 1; + /** + * Sexually explicit content. + * + * Generated from protobuf enum SEXUALLY_EXPLICIT = 2; + */ + const SEXUALLY_EXPLICIT = 2; + /** + * Harassment content. + * + * Generated from protobuf enum HARASSMENT = 3; + */ + const HARASSMENT = 3; + /** + * Hate speech content. + * + * Generated from protobuf enum HATE_SPEECH = 4; + */ + const HATE_SPEECH = 4; + + private static $valueToName = [ + self::RAI_CATEGORY_UNSPECIFIED => 'RAI_CATEGORY_UNSPECIFIED', + self::DANGEROUS_CONTENT => 'DANGEROUS_CONTENT', + self::SEXUALLY_EXPLICIT => 'SEXUALLY_EXPLICIT', + self::HARASSMENT => 'HARASSMENT', + self::HATE_SPEECH => 'HATE_SPEECH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/SensitivityLevel.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/SensitivityLevel.php new file mode 100644 index 000000000000..6c9815e65de9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RaiSettings/RaiCategoryConfig/SensitivityLevel.php @@ -0,0 +1,80 @@ +google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevel + */ +class SensitivityLevel +{ + /** + * Default value. + * If unspecified, the default behavior is: + * - DANGEROUS_CONTENT: BLOCK_FEW + * - SEXUALLY_EXPLICIT: BLOCK_SOME + * - HARASSMENT: BLOCK_SOME + * - HATE_SPEECH: BLOCK_SOME + * + * Generated from protobuf enum SENSITIVITY_LEVEL_UNSPECIFIED = 0; + */ + const SENSITIVITY_LEVEL_UNSPECIFIED = 0; + /** + * Block most potentially sensitive responses. + * + * Generated from protobuf enum BLOCK_MOST = 1; + */ + const BLOCK_MOST = 1; + /** + * Block some potentially sensitive responses. + * + * Generated from protobuf enum BLOCK_SOME = 2; + */ + const BLOCK_SOME = 2; + /** + * Block a few potentially sensitive responses. + * + * Generated from protobuf enum BLOCK_FEW = 3; + */ + const BLOCK_FEW = 3; + /** + * No filtering for this category. + * + * Generated from protobuf enum BLOCK_NONE = 4; + */ + const BLOCK_NONE = 4; + + private static $valueToName = [ + self::SENSITIVITY_LEVEL_UNSPECIFIED => 'SENSITIVITY_LEVEL_UNSPECIFIED', + self::BLOCK_MOST => 'BLOCK_MOST', + self::BLOCK_SOME => 'BLOCK_SOME', + self::BLOCK_FEW => 'BLOCK_FEW', + self::BLOCK_NONE => 'BLOCK_NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php new file mode 100644 index 000000000000..e0a97e18ed01 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php @@ -0,0 +1,225 @@ +google.cloud.dialogflow.v2.ReloadDocumentRequest + */ +class ReloadDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $import_gcs_custom_metadata = false; + /** + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $smart_messaging_partial_update = false; + protected $source; + + /** + * @param string $name Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * Please see {@see DocumentsClient::documentName()} for help formatting this field. + * @param string $contentUri Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * + * @return \Google\Cloud\Dialogflow\V2\ReloadDocumentRequest + * + * @experimental + */ + public static function build(string $name, string $contentUri): self + { + return (new self()) + ->setName($name) + ->setContentUri($contentUri); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * @type string $content_uri + * Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * @type bool $import_gcs_custom_metadata + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * @type bool $smart_messaging_partial_update + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * + * Generated from protobuf field string content_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getContentUri() + { + return $this->readOneof(3); + } + + public function hasContentUri() + { + return $this->hasOneof(3); + } + + /** + * Optional. The path of gcs source file for reloading document content. For + * now, only gcs uri is supported. + * For documents stored in Google Cloud Storage, these URIs must have + * the form `gs:///`. + * + * Generated from protobuf field string content_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setContentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getImportGcsCustomMetadata() + { + return $this->import_gcs_custom_metadata; + } + + /** + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * + * Generated from protobuf field bool import_gcs_custom_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setImportGcsCustomMetadata($var) + { + GPBUtil::checkBool($var); + $this->import_gcs_custom_metadata = $var; + + return $this; + } + + /** + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSmartMessagingPartialUpdate() + { + return $this->smart_messaging_partial_update; + } + + /** + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * + * Generated from protobuf field bool smart_messaging_partial_update = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSmartMessagingPartialUpdate($var) + { + GPBUtil::checkBool($var); + $this->smart_messaging_partial_update = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RestoreAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RestoreAgentRequest.php new file mode 100644 index 000000000000..52aebd5f2600 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RestoreAgentRequest.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.RestoreAgentRequest + */ +class RestoreAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + protected $agent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * @type string $agent_uri + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * @type string $agent_content + * Zip compressed raw byte content for agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @return string + */ + public function getAgentUri() + { + return $this->readOneof(2); + } + + public function hasAgentUri() + { + return $this->hasOneof(2); + } + + /** + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + * Dialogflow performs a read operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have read permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + * + * Generated from protobuf field string agent_uri = 2; + * @param string $var + * @return $this + */ + public function setAgentUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @return string + */ + public function getAgentContent() + { + return $this->readOneof(3); + } + + public function hasAgentContent() + { + return $this->hasOneof(3); + } + + /** + * Zip compressed raw byte content for agent. + * + * Generated from protobuf field bytes agent_content = 3; + * @param string $var + * @return $this + */ + public function setAgentContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAgent() + { + return $this->whichOneof("agent"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsRequest.php new file mode 100644 index 000000000000..342274f68ca8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsRequest.php @@ -0,0 +1,159 @@ +google.cloud.dialogflow.v2.SearchAgentsRequest + */ +class SearchAgentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to list agents from. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project to list agents from. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SearchAgentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to list agents from. + * Format: `projects/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to list agents from. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project to list agents from. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsResponse.php new file mode 100644 index 000000000000..c42246e4316a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsResponse.php @@ -0,0 +1,110 @@ +google.cloud.dialogflow.v2.SearchAgentsResponse + */ +class SearchAgentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Agent agents = 1; + */ + private $agents; + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Agent[] $agents + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Agent agents = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Agent> + */ + public function getAgents() + { + return $this->agents; + } + + /** + * The list of agents. There will be a maximum number of items returned based + * on the page_size field in the request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Agent agents = 1; + * @param \Google\Cloud\Dialogflow\V2\Agent[] $var + * @return $this + */ + public function setAgents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Agent::class); + $this->agents = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no + * more results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php new file mode 100644 index 000000000000..7b33875749eb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php @@ -0,0 +1,181 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer + */ +class SearchKnowledgeAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + */ + protected $answer = ''; + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + */ + protected $answer_type = 0; + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + */ + private $answer_sources; + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer + * The piece of text from the knowledge base documents that answers + * the search query + * @type int $answer_type + * The type of the answer. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource[] $answer_sources + * All sources used to generate the answer. + * @type string $answer_record + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + * @return string + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + * @param string $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkString($var, True); + $this->answer = $var; + + return $this; + } + + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + * @return int + */ + public function getAnswerType() + { + return $this->answer_type; + } + + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + * @param int $var + * @return $this + */ + public function setAnswerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerType::class); + $this->answer_type = $var; + + return $this; + } + + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource> + */ + public function getAnswerSources() + { + return $this->answer_sources; + } + + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource[] $var + * @return $this + */ + public function setAnswerSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource::class); + $this->answer_sources = $arr; + + return $this; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php new file mode 100644 index 000000000000..fa969c5437c2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php @@ -0,0 +1,179 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource + */ +class AnswerSource extends \Google\Protobuf\Internal\Message +{ + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + */ + protected $snippet = ''; + /** + * Metadata associated with the article. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The title of the article. + * @type string $uri + * The URI of the article. + * @type string $snippet + * The relevant snippet of the article. + * @type \Google\Protobuf\Struct $metadata + * Metadata associated with the article. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + * @return string + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + * @param string $var + * @return $this + */ + public function setSnippet($var) + { + GPBUtil::checkString($var, True); + $this->snippet = $var; + + return $this; + } + + /** + * Metadata associated with the article. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Metadata associated with the article. + * + * Generated from protobuf field .google.protobuf.Struct metadata = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php new file mode 100644 index 000000000000..9d03f6ba0db1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType + */ +class AnswerType +{ + /** + * The answer has a unspecified type. + * + * Generated from protobuf enum ANSWER_TYPE_UNSPECIFIED = 0; + */ + const ANSWER_TYPE_UNSPECIFIED = 0; + /** + * The answer is from FAQ documents. + * + * Generated from protobuf enum FAQ = 1; + */ + const FAQ = 1; + /** + * The answer is from generative model. + * + * Generated from protobuf enum GENERATIVE = 2; + */ + const GENERATIVE = 2; + /** + * The answer is from intent matching. + * + * Generated from protobuf enum INTENT = 3; + */ + const INTENT = 3; + /** + * The answer is from Playbook. + * + * Generated from protobuf enum PLAYBOOK = 4; + */ + const PLAYBOOK = 4; + /** + * The answer is from event. + * + * Generated from protobuf enum EVENT = 5; + */ + const EVENT = 5; + + private static $valueToName = [ + self::ANSWER_TYPE_UNSPECIFIED => 'ANSWER_TYPE_UNSPECIFIED', + self::FAQ => 'FAQ', + self::GENERATIVE => 'GENERATIVE', + self::INTENT => 'INTENT', + self::PLAYBOOK => 'PLAYBOOK', + self::EVENT => 'EVENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo.php new file mode 100644 index 000000000000..6e8887ae08c7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo.php @@ -0,0 +1,203 @@ +google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo + */ +class SearchKnowledgeDebugInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DatastoreResponseReason datastore_response_reason = 1; + */ + protected $datastore_response_reason = 0; + /** + * Configured behaviors for SearchKnowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior search_knowledge_behavior = 2; + */ + protected $search_knowledge_behavior = null; + /** + * Information about parameters ingested for search knowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo ingested_context_reference_debug_info = 3; + */ + protected $ingested_context_reference_debug_info = null; + /** + * The latency of the service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ServiceLatency service_latency = 4; + */ + protected $service_latency = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $datastore_response_reason + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo\SearchKnowledgeBehavior $search_knowledge_behavior + * Configured behaviors for SearchKnowledge. + * @type \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo $ingested_context_reference_debug_info + * Information about parameters ingested for search knowledge. + * @type \Google\Cloud\Dialogflow\V2\ServiceLatency $service_latency + * The latency of the service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DatastoreResponseReason datastore_response_reason = 1; + * @return int + */ + public function getDatastoreResponseReason() + { + return $this->datastore_response_reason; + } + + /** + * Response reason from datastore which indicates data serving status or + * answer quality degradation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DatastoreResponseReason datastore_response_reason = 1; + * @param int $var + * @return $this + */ + public function setDatastoreResponseReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\DatastoreResponseReason::class); + $this->datastore_response_reason = $var; + + return $this; + } + + /** + * Configured behaviors for SearchKnowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior search_knowledge_behavior = 2; + * @return \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo\SearchKnowledgeBehavior|null + */ + public function getSearchKnowledgeBehavior() + { + return $this->search_knowledge_behavior; + } + + public function hasSearchKnowledgeBehavior() + { + return isset($this->search_knowledge_behavior); + } + + public function clearSearchKnowledgeBehavior() + { + unset($this->search_knowledge_behavior); + } + + /** + * Configured behaviors for SearchKnowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior search_knowledge_behavior = 2; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo\SearchKnowledgeBehavior $var + * @return $this + */ + public function setSearchKnowledgeBehavior($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo\SearchKnowledgeBehavior::class); + $this->search_knowledge_behavior = $var; + + return $this; + } + + /** + * Information about parameters ingested for search knowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo ingested_context_reference_debug_info = 3; + * @return \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo|null + */ + public function getIngestedContextReferenceDebugInfo() + { + return $this->ingested_context_reference_debug_info; + } + + public function hasIngestedContextReferenceDebugInfo() + { + return isset($this->ingested_context_reference_debug_info); + } + + public function clearIngestedContextReferenceDebugInfo() + { + unset($this->ingested_context_reference_debug_info); + } + + /** + * Information about parameters ingested for search knowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo ingested_context_reference_debug_info = 3; + * @param \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo $var + * @return $this + */ + public function setIngestedContextReferenceDebugInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IngestedContextReferenceDebugInfo::class); + $this->ingested_context_reference_debug_info = $var; + + return $this; + } + + /** + * The latency of the service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ServiceLatency service_latency = 4; + * @return \Google\Cloud\Dialogflow\V2\ServiceLatency|null + */ + public function getServiceLatency() + { + return $this->service_latency; + } + + public function hasServiceLatency() + { + return isset($this->service_latency); + } + + public function clearServiceLatency() + { + unset($this->service_latency); + } + + /** + * The latency of the service. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ServiceLatency service_latency = 4; + * @param \Google\Cloud\Dialogflow\V2\ServiceLatency $var + * @return $this + */ + public function setServiceLatency($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ServiceLatency::class); + $this->service_latency = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo/SearchKnowledgeBehavior.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo/SearchKnowledgeBehavior.php new file mode 100644 index 000000000000..ac82e6e5f1ad --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeDebugInfo/SearchKnowledgeBehavior.php @@ -0,0 +1,143 @@ +google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior + */ +class SearchKnowledgeBehavior extends \Google\Protobuf\Internal\Message +{ + /** + * Whether data store agent rewriter was turned on for the request. + * + * Generated from protobuf field bool answer_generation_rewriter_on = 1; + */ + protected $answer_generation_rewriter_on = false; + /** + * Whether end_user_metadata is included in the data store agent call. + * + * Generated from protobuf field bool end_user_metadata_included = 2; + */ + protected $end_user_metadata_included = false; + /** + * This field indicates whether third party connectors are enabled for the + * project. Note that this field only indicates if the project is + * allowlisted for connectors. + * + * Generated from protobuf field bool third_party_connector_allowed = 4; + */ + protected $third_party_connector_allowed = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_generation_rewriter_on + * Whether data store agent rewriter was turned on for the request. + * @type bool $end_user_metadata_included + * Whether end_user_metadata is included in the data store agent call. + * @type bool $third_party_connector_allowed + * This field indicates whether third party connectors are enabled for the + * project. Note that this field only indicates if the project is + * allowlisted for connectors. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Whether data store agent rewriter was turned on for the request. + * + * Generated from protobuf field bool answer_generation_rewriter_on = 1; + * @return bool + */ + public function getAnswerGenerationRewriterOn() + { + return $this->answer_generation_rewriter_on; + } + + /** + * Whether data store agent rewriter was turned on for the request. + * + * Generated from protobuf field bool answer_generation_rewriter_on = 1; + * @param bool $var + * @return $this + */ + public function setAnswerGenerationRewriterOn($var) + { + GPBUtil::checkBool($var); + $this->answer_generation_rewriter_on = $var; + + return $this; + } + + /** + * Whether end_user_metadata is included in the data store agent call. + * + * Generated from protobuf field bool end_user_metadata_included = 2; + * @return bool + */ + public function getEndUserMetadataIncluded() + { + return $this->end_user_metadata_included; + } + + /** + * Whether end_user_metadata is included in the data store agent call. + * + * Generated from protobuf field bool end_user_metadata_included = 2; + * @param bool $var + * @return $this + */ + public function setEndUserMetadataIncluded($var) + { + GPBUtil::checkBool($var); + $this->end_user_metadata_included = $var; + + return $this; + } + + /** + * This field indicates whether third party connectors are enabled for the + * project. Note that this field only indicates if the project is + * allowlisted for connectors. + * + * Generated from protobuf field bool third_party_connector_allowed = 4; + * @return bool + */ + public function getThirdPartyConnectorAllowed() + { + return $this->third_party_connector_allowed; + } + + /** + * This field indicates whether third party connectors are enabled for the + * project. Note that this field only indicates if the project is + * allowlisted for connectors. + * + * Generated from protobuf field bool third_party_connector_allowed = 4; + * @param bool $var + * @return $this + */ + public function setThirdPartyConnectorAllowed($var) + { + GPBUtil::checkBool($var); + $this->third_party_connector_allowed = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php new file mode 100644 index 000000000000..5025273732d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php @@ -0,0 +1,516 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest + */ +class SearchKnowledgeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = null; + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation_profile = ''; + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_id = ''; + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. The source of the query in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource query_source = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query_source = 0; + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * + * Generated from protobuf field .google.protobuf.Struct end_user_metadata = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end_user_metadata = null; + /** + * Optional. Configuration specific to search queries with data stores. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig search_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $search_config = null; + /** + * Optional. Whether to search the query exactly without query rewrite. + * + * Generated from protobuf field bool exact_search = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $exact_search = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $query + * Required. The natural language text query for knowledge search. + * @type string $conversation_profile + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * @type string $session_id + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * @type string $conversation + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * @type string $latest_message + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * @type int $query_source + * Optional. The source of the query in the request. + * @type \Google\Protobuf\Struct $end_user_metadata + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig $search_config + * Optional. Configuration specific to search queries with data stores. + * @type bool $exact_search + * Optional. Whether to search the query exactly without query rewrite. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->query = $var; + + return $this; + } + + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSessionId() + { + return $this->session_id; + } + + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSessionId($var) + { + GPBUtil::checkString($var, True); + $this->session_id = $var; + + return $this; + } + + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. The source of the query in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource query_source = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getQuerySource() + { + return $this->query_source; + } + + /** + * Optional. The source of the query in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource query_source = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setQuerySource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\QuerySource::class); + $this->query_source = $var; + + return $this; + } + + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * + * Generated from protobuf field .google.protobuf.Struct end_user_metadata = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getEndUserMetadata() + { + return $this->end_user_metadata; + } + + public function hasEndUserMetadata() + { + return isset($this->end_user_metadata); + } + + public function clearEndUserMetadata() + { + unset($this->end_user_metadata); + } + + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * + * Generated from protobuf field .google.protobuf.Struct end_user_metadata = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setEndUserMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->end_user_metadata = $var; + + return $this; + } + + /** + * Optional. Configuration specific to search queries with data stores. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig search_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig|null + */ + public function getSearchConfig() + { + return $this->search_config; + } + + public function hasSearchConfig() + { + return isset($this->search_config); + } + + public function clearSearchConfig() + { + unset($this->search_config); + } + + /** + * Optional. Configuration specific to search queries with data stores. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig search_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig $var + * @return $this + */ + public function setSearchConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig::class); + $this->search_config = $var; + + return $this; + } + + /** + * Optional. Whether to search the query exactly without query rewrite. + * + * Generated from protobuf field bool exact_search = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExactSearch() + { + return $this->exact_search; + } + + /** + * Optional. Whether to search the query exactly without query rewrite. + * + * Generated from protobuf field bool exact_search = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExactSearch($var) + { + GPBUtil::checkBool($var); + $this->exact_search = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/QuerySource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/QuerySource.php new file mode 100644 index 000000000000..109f3b5f6f85 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/QuerySource.php @@ -0,0 +1,66 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource + */ +class QuerySource +{ + /** + * Unknown query source. + * + * Generated from protobuf enum QUERY_SOURCE_UNSPECIFIED = 0; + */ + const QUERY_SOURCE_UNSPECIFIED = 0; + /** + * The query is from agents. + * + * Generated from protobuf enum AGENT_QUERY = 1; + */ + const AGENT_QUERY = 1; + /** + * The query is a suggested query from + * [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist]. + * + * Generated from protobuf enum SUGGESTED_QUERY = 2; + */ + const SUGGESTED_QUERY = 2; + + private static $valueToName = [ + self::QUERY_SOURCE_UNSPECIFIED => 'QUERY_SOURCE_UNSPECIFIED', + self::AGENT_QUERY => 'AGENT_QUERY', + self::SUGGESTED_QUERY => 'SUGGESTED_QUERY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig.php new file mode 100644 index 000000000000..286960ff5d64 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig + */ +class SearchConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $boost_specs; + /** + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs filter_specs = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter_specs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs[] $boost_specs + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs[] $filter_specs + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs> + */ + public function getBoostSpecs() + { + return $this->boost_specs; + } + + /** + * Optional. Boost specifications for data stores. + * Maps from datastore name to their boost configuration. Do not specify + * more than one BoostSpecs for each datastore name. If multiple BoostSpecs + * are provided for the same datastore name, the behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs[] $var + * @return $this + */ + public function setBoostSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs::class); + $this->boost_specs = $arr; + + return $this; + } + + /** + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs filter_specs = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs> + */ + public function getFilterSpecs() + { + return $this->filter_specs; + } + + /** + * Optional. Filter specification for data store queries. + * TMaps from datastore name to the filter expression for that datastore. Do + * not specify more than one FilterSpecs for each datastore name. If + * multiple FilterSpecs are provided for the same datastore name, the + * behavior is undefined. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs filter_specs = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs[] $var + * @return $this + */ + public function setFilterSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\FilterSpecs::class); + $this->filter_specs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php new file mode 100644 index 000000000000..356a80374c6b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs.php @@ -0,0 +1,113 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs + */ +class BoostSpecs extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $data_stores; + /** + * Optional. A list of boosting specifications. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec spec = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $spec; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $data_stores + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec[] $spec + * Optional. A list of boosting specifications. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getDataStores() + { + return $this->data_stores; + } + + /** + * Optional. Data Stores where the boosting configuration is applied. The + * full names of the referenced data stores. Formats: + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * `projects/{project}/locations/{location}/dataStores/{data_store}` + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setDataStores($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_stores = $arr; + + return $this; + } + + /** + * Optional. A list of boosting specifications. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec spec = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec> + */ + public function getSpec() + { + return $this->spec; + } + + /** + * Optional. A list of boosting specifications. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec spec = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec[] $var + * @return $this + */ + public function setSpec($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec::class); + $this->spec = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php new file mode 100644 index 000000000000..2365f06ad442 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + */ +class BoostSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec condition_boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $condition_boost_specs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec[] $condition_boost_specs + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec condition_boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec> + */ + public function getConditionBoostSpecs() + { + return $this->condition_boost_specs; + } + + /** + * Optional. Condition boost specifications. If a document matches + * multiple conditions in the specifications, boost scores from these + * specifications are all applied and combined in a non-linear way. + * Maximum number of specifications is 20. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec condition_boost_specs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec[] $var + * @return $this + */ + public function setConditionBoostSpecs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec::class); + $this->condition_boost_specs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php new file mode 100644 index 000000000000..180bb4379e89 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec.php @@ -0,0 +1,229 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + */ +class ConditionBoostSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition = ''; + /** + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost = 0.0; + /** + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost_control_spec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $condition + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * @type float $boost + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec $boost_control_spec + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCondition() + { + return $this->condition; + } + + /** + * Optional. An expression which specifies a boost condition. The + * syntax and supported fields are the same as a filter expression. + * Examples: + * * To boost documents with document ID "doc_1" or "doc_2", and + * color + * "Red" or "Blue": + * * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + * + * Generated from protobuf field string condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkString($var, True); + $this->condition = $var; + + return $this; + } + + /** + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Optional. Strength of the condition boost, which should be in [-1, + * 1]. Negative boost means demotion. Default is 0.0. + * Setting to 1.0 gives the document a big promotion. However, it does + * not necessarily mean that the boosted document will be the top + * result at all times, nor that other documents will be excluded. + * Results could still be shown even when none of them matches the + * condition. And results that are significantly more relevant to the + * search query can still trump your heavily favored but irrelevant + * documents. + * Setting to -1.0 gives the document a big demotion. However, results + * that are deeply relevant might still be shown. The document will + * have an upstream battle to get a fairly high ranking, but it is not + * blocked out completely. + * Setting to 0.0 means no boost applied. The boosting condition is + * ignored. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + + /** + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec|null + */ + public function getBoostControlSpec() + { + return $this->boost_control_spec; + } + + public function hasBoostControlSpec() + { + return isset($this->boost_control_spec); + } + + public function clearBoostControlSpec() + { + unset($this->boost_control_spec); + } + + /** + * Optional. Complex specification for custom ranking based on + * customer defined attribute value. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec $var + * @return $this + */ + public function setBoostControlSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec::class); + $this->boost_control_spec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php new file mode 100644 index 000000000000..c615f76f741b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec.php @@ -0,0 +1,208 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + */ +class BoostControlSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * + * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $field_name = ''; + /** + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $attribute_type = 0; + /** + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $interpolation_type = 0; + /** + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $control_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_name + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * @type int $attribute_type + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * @type int $interpolation_type + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint[] $control_points + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * + * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFieldName() + { + return $this->field_name; + } + + /** + * Optional. The name of the field whose value will be used to + * determine the boost amount. + * + * Generated from protobuf field string field_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFieldName($var) + { + GPBUtil::checkString($var, True); + $this->field_name = $var; + + return $this; + } + + /** + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAttributeType() + { + return $this->attribute_type; + } + + /** + * Optional. The attribute type to be used to determine the boost + * amount. The attribute value can be derived from the field value + * of the specified field_name. In the case of numerical it is + * straightforward i.e. attribute_value = numerical_field_value. In + * the case of freshness however, attribute_value = (time.now() - + * datetime_field_value). + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAttributeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\AttributeType::class); + $this->attribute_type = $var; + + return $this; + } + + /** + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInterpolationType() + { + return $this->interpolation_type; + } + + /** + * Optional. The interpolation type to be applied to connect the + * control points listed below. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInterpolationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\InterpolationType::class); + $this->interpolation_type = $var; + + return $this; + } + + /** + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint> + */ + public function getControlPoints() + { + return $this->control_points; + } + + /** + * Optional. The control points used to define the curve. The + * monotonic function (defined through the interpolation_type above) + * passes through the control points listed here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint[] $var + * @return $this + */ + public function setControlPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint::class); + $this->control_points = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php new file mode 100644 index 000000000000..9a4559cfdc27 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + */ +class AttributeType +{ + /** + * Unspecified AttributeType. + * + * Generated from protobuf enum ATTRIBUTE_TYPE_UNSPECIFIED = 0; + */ + const ATTRIBUTE_TYPE_UNSPECIFIED = 0; + /** + * The value of the numerical field will be used to dynamically + * update the boost amount. In this case, the attribute_value (the + * x value) of the control point will be the actual value of the + * numerical field for which the boost_amount is specified. + * + * Generated from protobuf enum NUMERICAL = 1; + */ + const NUMERICAL = 1; + /** + * For the freshness use case the attribute value will be the + * duration between the current time and the date in the datetime + * field specified. The value must be formatted as an XSD + * `dayTimeDuration` value (a restricted subset of an ISO 8601 + * duration value). The pattern for this is: + * `[nD][T[nH][nM][nS]]`. E.g. `5D`, `3DT12H30M`, `T24H`. + * + * Generated from protobuf enum FRESHNESS = 2; + */ + const FRESHNESS = 2; + + private static $valueToName = [ + self::ATTRIBUTE_TYPE_UNSPECIFIED => 'ATTRIBUTE_TYPE_UNSPECIFIED', + self::NUMERICAL => 'NUMERICAL', + self::FRESHNESS => 'FRESHNESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php new file mode 100644 index 000000000000..dad02c8a6719 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php @@ -0,0 +1,127 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + */ +class ControlPoint extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $attribute_value = ''; + /** + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost_amount = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attribute_value + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * @type float $boost_amount + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAttributeValue() + { + return $this->attribute_value; + } + + /** + * Optional. Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value + * (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAttributeValue($var) + { + GPBUtil::checkString($var, True); + $this->attribute_value = $var; + + return $this; + } + + /** + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoostAmount() + { + return $this->boost_amount; + } + + /** + * Optional. The value between -1 to 1 by which to boost the score + * if the attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoostAmount($var) + { + GPBUtil::checkFloat($var); + $this->boost_amount = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php new file mode 100644 index 000000000000..503df98521f8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/BoostSpecs/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php @@ -0,0 +1,56 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + */ +class InterpolationType +{ + /** + * Interpolation type is unspecified. In this case, it defaults to + * Linear. + * + * Generated from protobuf enum INTERPOLATION_TYPE_UNSPECIFIED = 0; + */ + const INTERPOLATION_TYPE_UNSPECIFIED = 0; + /** + * Piecewise linear interpolation will be applied. + * + * Generated from protobuf enum LINEAR = 1; + */ + const LINEAR = 1; + + private static $valueToName = [ + self::INTERPOLATION_TYPE_UNSPECIFIED => 'INTERPOLATION_TYPE_UNSPECIFIED', + self::LINEAR => 'LINEAR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php new file mode 100644 index 000000000000..c7158b2f9280 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest/SearchConfig/FilterSpecs.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs + */ +class FilterSpecs extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $data_stores; + /** + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $data_stores + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * @type string $filter + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getDataStores() + { + return $this->data_stores; + } + + /** + * Optional. The data store where the filter configuration is applied. + * Full resource name of data store, such as + * projects/{project}/locations/{location}/collections/{collectionId}/ + * dataStores/{dataStoreId}. + * + * Generated from protobuf field repeated string data_stores = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setDataStores($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_stores = $arr; + + return $this; + } + + /** + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter expression to be applied. + * Expression syntax is documented at + * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php new file mode 100644 index 000000000000..fbdf2a655810 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.SearchKnowledgeResponse + */ +class SearchKnowledgeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + */ + private $answers; + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + */ + protected $rewritten_query = ''; + /** + * Debug info for SearchKnowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo search_knowledge_debug_info = 4; + */ + protected $search_knowledge_debug_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer[] $answers + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * @type string $rewritten_query + * The rewritten query used to search knowledge. + * @type \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo $search_knowledge_debug_info + * Debug info for SearchKnowledge. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer> + */ + public function getAnswers() + { + return $this->answers; + } + + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer[] $var + * @return $this + */ + public function setAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer::class); + $this->answers = $arr; + + return $this; + } + + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + * @return string + */ + public function getRewrittenQuery() + { + return $this->rewritten_query; + } + + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + * @param string $var + * @return $this + */ + public function setRewrittenQuery($var) + { + GPBUtil::checkString($var, True); + $this->rewritten_query = $var; + + return $this; + } + + /** + * Debug info for SearchKnowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo search_knowledge_debug_info = 4; + * @return \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo|null + */ + public function getSearchKnowledgeDebugInfo() + { + return $this->search_knowledge_debug_info; + } + + public function hasSearchKnowledgeDebugInfo() + { + return isset($this->search_knowledge_debug_info); + } + + public function clearSearchKnowledgeDebugInfo() + { + unset($this->search_knowledge_debug_info); + } + + /** + * Debug info for SearchKnowledge. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo search_knowledge_debug_info = 4; + * @param \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo $var + * @return $this + */ + public function setSearchKnowledgeDebugInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeDebugInfo::class); + $this->search_knowledge_debug_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php new file mode 100644 index 000000000000..817694ebe9a2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php @@ -0,0 +1,112 @@ +google.cloud.dialogflow.v2.Sentiment + */ +class Sentiment extends \Google\Protobuf\Internal\Message +{ + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * + * Generated from protobuf field float score = 1; + */ + protected $score = 0.0; + /** + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * + * Generated from protobuf field float magnitude = 2; + */ + protected $magnitude = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $score + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * @type float $magnitude + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * + * Generated from protobuf field float score = 1; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + * + * Generated from protobuf field float score = 1; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * + * Generated from protobuf field float magnitude = 2; + * @return float + */ + public function getMagnitude() + { + return $this->magnitude; + } + + /** + * A non-negative number in the [0, +inf) range, which represents the absolute + * magnitude of sentiment, regardless of score (positive or negative). + * + * Generated from protobuf field float magnitude = 2; + * @param float $var + * @return $this + */ + public function setMagnitude($var) + { + GPBUtil::checkFloat($var); + $this->magnitude = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php new file mode 100644 index 000000000000..eeed098b6541 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + */ +class SentimentAnalysisRequestConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * + * Generated from protobuf field bool analyze_query_text_sentiment = 1; + */ + protected $analyze_query_text_sentiment = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $analyze_query_text_sentiment + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * + * Generated from protobuf field bool analyze_query_text_sentiment = 1; + * @return bool + */ + public function getAnalyzeQueryTextSentiment() + { + return $this->analyze_query_text_sentiment; + } + + /** + * Instructs the service to perform sentiment analysis on + * `query_text`. If not provided, sentiment analysis is not performed on + * `query_text`. + * + * Generated from protobuf field bool analyze_query_text_sentiment = 1; + * @param bool $var + * @return $this + */ + public function setAnalyzeQueryTextSentiment($var) + { + GPBUtil::checkBool($var); + $this->analyze_query_text_sentiment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php new file mode 100644 index 000000000000..7a8fc27d1b98 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php @@ -0,0 +1,89 @@ +google.cloud.dialogflow.v2.SentimentAnalysisResult + */ +class SentimentAnalysisResult extends \Google\Protobuf\Internal\Message +{ + /** + * The sentiment analysis result for `query_text`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; + */ + protected $query_text_sentiment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Sentiment $query_text_sentiment + * The sentiment analysis result for `query_text`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The sentiment analysis result for `query_text`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; + * @return \Google\Cloud\Dialogflow\V2\Sentiment|null + */ + public function getQueryTextSentiment() + { + return $this->query_text_sentiment; + } + + public function hasQueryTextSentiment() + { + return isset($this->query_text_sentiment); + } + + public function clearQueryTextSentiment() + { + unset($this->query_text_sentiment); + } + + /** + * The sentiment analysis result for `query_text`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; + * @param \Google\Cloud\Dialogflow\V2\Sentiment $var + * @return $this + */ + public function setQueryTextSentiment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Sentiment::class); + $this->query_text_sentiment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency.php new file mode 100644 index 000000000000..eb8845c3d711 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ServiceLatency + */ +class ServiceLatency extends \Google\Protobuf\Internal\Message +{ + /** + * A list of internal service latencies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency internal_service_latencies = 1; + */ + private $internal_service_latencies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ServiceLatency\InternalServiceLatency[] $internal_service_latencies + * A list of internal service latencies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * A list of internal service latencies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency internal_service_latencies = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ServiceLatency\InternalServiceLatency> + */ + public function getInternalServiceLatencies() + { + return $this->internal_service_latencies; + } + + /** + * A list of internal service latencies. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency internal_service_latencies = 1; + * @param \Google\Cloud\Dialogflow\V2\ServiceLatency\InternalServiceLatency[] $var + * @return $this + */ + public function setInternalServiceLatencies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ServiceLatency\InternalServiceLatency::class); + $this->internal_service_latencies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency/InternalServiceLatency.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency/InternalServiceLatency.php new file mode 100644 index 000000000000..0d35f6c397e3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ServiceLatency/InternalServiceLatency.php @@ -0,0 +1,189 @@ +google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency + */ +class InternalServiceLatency extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the internal service. + * + * Generated from protobuf field string step = 1; + */ + protected $step = ''; + /** + * The latency of the internal service in milliseconds. + * + * Generated from protobuf field float latency_ms = 2; + */ + protected $latency_ms = 0.0; + /** + * The start time of the internal service. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + */ + protected $start_time = null; + /** + * The completion time of the internal service. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 4; + */ + protected $complete_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $step + * The name of the internal service. + * @type float $latency_ms + * The latency of the internal service in milliseconds. + * @type \Google\Protobuf\Timestamp $start_time + * The start time of the internal service. + * @type \Google\Protobuf\Timestamp $complete_time + * The completion time of the internal service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The name of the internal service. + * + * Generated from protobuf field string step = 1; + * @return string + */ + public function getStep() + { + return $this->step; + } + + /** + * The name of the internal service. + * + * Generated from protobuf field string step = 1; + * @param string $var + * @return $this + */ + public function setStep($var) + { + GPBUtil::checkString($var, True); + $this->step = $var; + + return $this; + } + + /** + * The latency of the internal service in milliseconds. + * + * Generated from protobuf field float latency_ms = 2; + * @return float + */ + public function getLatencyMs() + { + return $this->latency_ms; + } + + /** + * The latency of the internal service in milliseconds. + * + * Generated from protobuf field float latency_ms = 2; + * @param float $var + * @return $this + */ + public function setLatencyMs($var) + { + GPBUtil::checkFloat($var); + $this->latency_ms = $var; + + return $this; + } + + /** + * The start time of the internal service. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start time of the internal service. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The completion time of the internal service. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompleteTime() + { + return $this->complete_time; + } + + public function hasCompleteTime() + { + return isset($this->complete_time); + } + + public function clearCompleteTime() + { + unset($this->complete_time); + } + + /** + * The completion time of the internal service. + * + * Generated from protobuf field .google.protobuf.Timestamp complete_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->complete_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php new file mode 100644 index 000000000000..cc5746729f81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php @@ -0,0 +1,181 @@ +google.cloud.dialogflow.v2.SessionEntityType + */ +class SessionEntityType extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode entity_override_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_override_mode = 0; + /** + * Required. The collection of entities associated with this session entity + * type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $entities; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * @type int $entity_override_mode + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * @type \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $entities + * Required. The collection of entities associated with this session entity + * type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode entity_override_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEntityOverrideMode() + { + return $this->entity_override_mode; + } + + /** + * Required. Indicates whether the additional data should override or + * supplement the custom entity type definition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode entity_override_mode = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEntityOverrideMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SessionEntityType\EntityOverrideMode::class); + $this->entity_override_mode = $var; + + return $this; + } + + /** + * Required. The collection of entities associated with this session entity + * type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\EntityType\Entity> + */ + public function getEntities() + { + return $this->entities; + } + + /** + * Required. The collection of entities associated with this session entity + * type. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.EntityType.Entity entities = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType\Entity[] $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\EntityType\Entity::class); + $this->entities = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php new file mode 100644 index 000000000000..ed0d51923d5a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode + */ +class EntityOverrideMode +{ + /** + * Not specified. This value should be never used. + * + * Generated from protobuf enum ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + */ + const ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + /** + * The collection of session entities overrides the collection of entities + * in the corresponding custom entity type. + * + * Generated from protobuf enum ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + */ + const ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + /** + * The collection of session entities extends the collection of entities in + * the corresponding custom entity type. + * Note: Even in this override mode calls to `ListSessionEntityTypes`, + * `GetSessionEntityType`, `CreateSessionEntityType` and + * `UpdateSessionEntityType` only return the additional entities added in + * this session entity type. If you want to get the supplemented list, + * please call + * [EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType] + * on the custom entity type and merge. + * + * Generated from protobuf enum ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + */ + const ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + + private static $valueToName = [ + self::ENTITY_OVERRIDE_MODE_UNSPECIFIED => 'ENTITY_OVERRIDE_MODE_UNSPECIFIED', + self::ENTITY_OVERRIDE_MODE_OVERRIDE => 'ENTITY_OVERRIDE_MODE_OVERRIDE', + self::ENTITY_OVERRIDE_MODE_SUPPLEMENT => 'ENTITY_OVERRIDE_MODE_SUPPLEMENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetAgentRequest.php new file mode 100644 index 000000000000..c2b3b2e980d4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetAgentRequest.php @@ -0,0 +1,135 @@ +google.cloud.dialogflow.v2.SetAgentRequest + */ +class SetAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The agent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $agent = null; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Agent $agent Required. The agent to update. + * + * @return \Google\Cloud\Dialogflow\V2\SetAgentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Agent $agent): self + { + return (new self()) + ->setAgent($agent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Agent $agent + * Required. The agent to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The agent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Agent|null + */ + public function getAgent() + { + return $this->agent; + } + + public function hasAgent() + { + return isset($this->agent); + } + + public function clearAgent() + { + unset($this->agent); + } + + /** + * Required. The agent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Agent agent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Agent $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Agent::class); + $this->agent = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php new file mode 100644 index 000000000000..06b97fce1439 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php @@ -0,0 +1,193 @@ +google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata + */ +class SetSuggestionFeatureConfigOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The type of the suggestion feature to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_type = 0; + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * @type int $participant_role + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type int $suggestion_feature_type + * Required. The type of the suggestion feature to add or update. + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp whe the request was created. The time is measured on server side. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * The resource name of the conversation profile. Format: + * `projects//locations//conversationProfiles/` + * + * Generated from protobuf field string conversation_profile = 1; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The type of the suggestion feature to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSuggestionFeatureType() + { + return $this->suggestion_feature_type; + } + + /** + * Required. The type of the suggestion feature to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type suggestion_feature_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSuggestionFeatureType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->suggestion_feature_type = $var; + + return $this; + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp whe the request was created. The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigRequest.php new file mode 100644 index 000000000000..a262a5183012 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigRequest.php @@ -0,0 +1,194 @@ +google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest + */ +class SetSuggestionFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = ''; + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant_role = 0; + /** + * Required. The suggestion feature config to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig suggestion_feature_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $suggestion_feature_config = null; + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * @return \Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function build(string $conversationProfile): self + { + return (new self()) + ->setConversationProfile($conversationProfile); + } + + /** + * @param string $conversationProfile Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @param int $participantRole Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\Participant\Role} + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $suggestionFeatureConfig Required. The suggestion feature config to add or update. + * + * @return \Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigRequest + * + * @experimental + */ + public static function buildFromConversationProfileParticipantRoleSuggestionFeatureConfig(string $conversationProfile, int $participantRole, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $suggestionFeatureConfig): self + { + return (new self()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureConfig($suggestionFeatureConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_profile + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * @type int $participant_role + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $suggestion_feature_config + * Required. The suggestion feature config to add or update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to add or update the suggestion feature + * config. Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getParticipantRole() + { + return $this->participant_role; + } + + /** + * Required. The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant.Role participant_role = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setParticipantRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Participant\Role::class); + $this->participant_role = $var; + + return $this; + } + + /** + * Required. The suggestion feature config to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig suggestion_feature_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig|null + */ + public function getSuggestionFeatureConfig() + { + return $this->suggestion_feature_config; + } + + public function hasSuggestionFeatureConfig() + { + return isset($this->suggestion_feature_config); + } + + public function clearSuggestionFeatureConfig() + { + unset($this->suggestion_feature_config); + } + + /** + * Required. The suggestion feature config to add or update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig suggestion_feature_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig $var + * @return $this + */ + public function setSuggestionFeatureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig::class); + $this->suggestion_feature_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipConfig.php new file mode 100644 index 000000000000..2ca0a997a06a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipConfig.php @@ -0,0 +1,305 @@ +google.cloud.dialogflow.v2.SipConfig + */ +class SipConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Asks Dialogflow Telephony to create the conversation provided in the SIP + * header on the fly when the call comes in. + * + * Generated from protobuf field bool create_conversation_on_the_fly = 1; + */ + protected $create_conversation_on_the_fly = false; + /** + * Starts the conversation with inactive SDP directives + * + * Generated from protobuf field bool inactive_start = 3; + */ + protected $inactive_start = false; + /** + * Max duration for audio recording. + * Overrides the default value of 15 min. + * Max value is 8 hours. + * + * Generated from protobuf field .google.protobuf.Duration max_audio_recording_duration = 4; + */ + protected $max_audio_recording_duration = null; + /** + * Allows interactions with a Dialogflow virtual agent even if the call is + * connected for SIPREC purposes. + * + * Generated from protobuf field bool allow_virtual_agent_interaction = 5; + */ + protected $allow_virtual_agent_interaction = false; + /** + * Keeps the conversation running even if the call is disconnected. + * + * Generated from protobuf field bool keep_conversation_running = 6; + */ + protected $keep_conversation_running = false; + /** + * List of inbound call leg headers to be copied to outbound call legs created + * later. + * + * Generated from protobuf field repeated string copy_inbound_call_leg_headers = 8; + */ + private $copy_inbound_call_leg_headers; + /** + * Ignores any media direction in the reINVITE SDP offer. Reuse the previous + * media direction. + * + * Generated from protobuf field bool ignore_reinvite_media_direction = 9; + */ + protected $ignore_reinvite_media_direction = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $create_conversation_on_the_fly + * Asks Dialogflow Telephony to create the conversation provided in the SIP + * header on the fly when the call comes in. + * @type bool $inactive_start + * Starts the conversation with inactive SDP directives + * @type \Google\Protobuf\Duration $max_audio_recording_duration + * Max duration for audio recording. + * Overrides the default value of 15 min. + * Max value is 8 hours. + * @type bool $allow_virtual_agent_interaction + * Allows interactions with a Dialogflow virtual agent even if the call is + * connected for SIPREC purposes. + * @type bool $keep_conversation_running + * Keeps the conversation running even if the call is disconnected. + * @type string[] $copy_inbound_call_leg_headers + * List of inbound call leg headers to be copied to outbound call legs created + * later. + * @type bool $ignore_reinvite_media_direction + * Ignores any media direction in the reINVITE SDP offer. Reuse the previous + * media direction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Asks Dialogflow Telephony to create the conversation provided in the SIP + * header on the fly when the call comes in. + * + * Generated from protobuf field bool create_conversation_on_the_fly = 1; + * @return bool + */ + public function getCreateConversationOnTheFly() + { + return $this->create_conversation_on_the_fly; + } + + /** + * Asks Dialogflow Telephony to create the conversation provided in the SIP + * header on the fly when the call comes in. + * + * Generated from protobuf field bool create_conversation_on_the_fly = 1; + * @param bool $var + * @return $this + */ + public function setCreateConversationOnTheFly($var) + { + GPBUtil::checkBool($var); + $this->create_conversation_on_the_fly = $var; + + return $this; + } + + /** + * Starts the conversation with inactive SDP directives + * + * Generated from protobuf field bool inactive_start = 3; + * @return bool + */ + public function getInactiveStart() + { + return $this->inactive_start; + } + + /** + * Starts the conversation with inactive SDP directives + * + * Generated from protobuf field bool inactive_start = 3; + * @param bool $var + * @return $this + */ + public function setInactiveStart($var) + { + GPBUtil::checkBool($var); + $this->inactive_start = $var; + + return $this; + } + + /** + * Max duration for audio recording. + * Overrides the default value of 15 min. + * Max value is 8 hours. + * + * Generated from protobuf field .google.protobuf.Duration max_audio_recording_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxAudioRecordingDuration() + { + return $this->max_audio_recording_duration; + } + + public function hasMaxAudioRecordingDuration() + { + return isset($this->max_audio_recording_duration); + } + + public function clearMaxAudioRecordingDuration() + { + unset($this->max_audio_recording_duration); + } + + /** + * Max duration for audio recording. + * Overrides the default value of 15 min. + * Max value is 8 hours. + * + * Generated from protobuf field .google.protobuf.Duration max_audio_recording_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxAudioRecordingDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_audio_recording_duration = $var; + + return $this; + } + + /** + * Allows interactions with a Dialogflow virtual agent even if the call is + * connected for SIPREC purposes. + * + * Generated from protobuf field bool allow_virtual_agent_interaction = 5; + * @return bool + */ + public function getAllowVirtualAgentInteraction() + { + return $this->allow_virtual_agent_interaction; + } + + /** + * Allows interactions with a Dialogflow virtual agent even if the call is + * connected for SIPREC purposes. + * + * Generated from protobuf field bool allow_virtual_agent_interaction = 5; + * @param bool $var + * @return $this + */ + public function setAllowVirtualAgentInteraction($var) + { + GPBUtil::checkBool($var); + $this->allow_virtual_agent_interaction = $var; + + return $this; + } + + /** + * Keeps the conversation running even if the call is disconnected. + * + * Generated from protobuf field bool keep_conversation_running = 6; + * @return bool + */ + public function getKeepConversationRunning() + { + return $this->keep_conversation_running; + } + + /** + * Keeps the conversation running even if the call is disconnected. + * + * Generated from protobuf field bool keep_conversation_running = 6; + * @param bool $var + * @return $this + */ + public function setKeepConversationRunning($var) + { + GPBUtil::checkBool($var); + $this->keep_conversation_running = $var; + + return $this; + } + + /** + * List of inbound call leg headers to be copied to outbound call legs created + * later. + * + * Generated from protobuf field repeated string copy_inbound_call_leg_headers = 8; + * @return RepeatedField + */ + public function getCopyInboundCallLegHeaders() + { + return $this->copy_inbound_call_leg_headers; + } + + /** + * List of inbound call leg headers to be copied to outbound call legs created + * later. + * + * Generated from protobuf field repeated string copy_inbound_call_leg_headers = 8; + * @param string[] $var + * @return $this + */ + public function setCopyInboundCallLegHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->copy_inbound_call_leg_headers = $arr; + + return $this; + } + + /** + * Ignores any media direction in the reINVITE SDP offer. Reuse the previous + * media direction. + * + * Generated from protobuf field bool ignore_reinvite_media_direction = 9; + * @return bool + */ + public function getIgnoreReinviteMediaDirection() + { + return $this->ignore_reinvite_media_direction; + } + + /** + * Ignores any media direction in the reINVITE SDP offer. Reuse the previous + * media direction. + * + * Generated from protobuf field bool ignore_reinvite_media_direction = 9; + * @param bool $var + * @return $this + */ + public function setIgnoreReinviteMediaDirection($var) + { + GPBUtil::checkBool($var); + $this->ignore_reinvite_media_direction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipTrunk.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipTrunk.php new file mode 100644 index 000000000000..f69ff6ae9262 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SipTrunk.php @@ -0,0 +1,182 @@ +google.cloud.dialogflow.v2.SipTrunk + */ +class SipTrunk extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The unique identifier of the SIP trunk. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. The expected hostnames in the peer certificate from partner that + * is used for TLS authentication. + * + * Generated from protobuf field repeated string expected_hostname = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $expected_hostname; + /** + * Output only. Connections of the SIP trunk. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Connection connections = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $connections; + /** + * Optional. Human readable alias for this trunk. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The unique identifier of the SIP trunk. + * Format: `projects//locations//sipTrunks/`. + * @type string[] $expected_hostname + * Required. The expected hostnames in the peer certificate from partner that + * is used for TLS authentication. + * @type \Google\Cloud\Dialogflow\V2\Connection[] $connections + * Output only. Connections of the SIP trunk. + * @type string $display_name + * Optional. Human readable alias for this trunk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The unique identifier of the SIP trunk. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The unique identifier of the SIP trunk. + * Format: `projects//locations//sipTrunks/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The expected hostnames in the peer certificate from partner that + * is used for TLS authentication. + * + * Generated from protobuf field repeated string expected_hostname = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getExpectedHostname() + { + return $this->expected_hostname; + } + + /** + * Required. The expected hostnames in the peer certificate from partner that + * is used for TLS authentication. + * + * Generated from protobuf field repeated string expected_hostname = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setExpectedHostname($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->expected_hostname = $arr; + + return $this; + } + + /** + * Output only. Connections of the SIP trunk. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Connection connections = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Connection> + */ + public function getConnections() + { + return $this->connections; + } + + /** + * Output only. Connections of the SIP trunk. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Connection connections = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\Connection[] $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Connection::class); + $this->connections = $arr; + + return $this; + } + + /** + * Optional. Human readable alias for this trunk. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Human readable alias for this trunk. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php new file mode 100644 index 000000000000..b26483a89059 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php @@ -0,0 +1,155 @@ +google.cloud.dialogflow.v2.SmartReplyAnswer + */ +class SmartReplyAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The content of the reply. + * + * Generated from protobuf field string reply = 1; + */ + protected $reply = ''; + /** + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reply + * The content of the reply. + * @type float $confidence + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The content of the reply. + * + * Generated from protobuf field string reply = 1; + * @return string + */ + public function getReply() + { + return $this->reply; + } + + /** + * The content of the reply. + * + * Generated from protobuf field string reply = 1; + * @param string $var + * @return $this + */ + public function setReply($var) + { + GPBUtil::checkString($var, True); + $this->reply = $var; + + return $this; + } + + /** + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Smart reply confidence. + * The system's confidence score that this reply is a good match for + * this conversation, as a value from 0.0 (completely uncertain) to 1.0 + * (completely certain). + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics.php new file mode 100644 index 000000000000..92d540dea2d3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics.php @@ -0,0 +1,143 @@ +google.cloud.dialogflow.v2.SmartReplyMetrics + */ +class SmartReplyMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * + * Generated from protobuf field float allowlist_coverage = 1; + */ + protected $allowlist_coverage = 0.0; + /** + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics top_n_metrics = 2; + */ + private $top_n_metrics; + /** + * Total number of conversations used to generate this metric. + * + * Generated from protobuf field int64 conversation_count = 3; + */ + protected $conversation_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $allowlist_coverage + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * @type \Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics[] $top_n_metrics + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * @type int|string $conversation_count + * Total number of conversations used to generate this metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * + * Generated from protobuf field float allowlist_coverage = 1; + * @return float + */ + public function getAllowlistCoverage() + { + return $this->allowlist_coverage; + } + + /** + * Percentage of target participant messages in the evaluation dataset for + * which similar messages have appeared at least once in the allowlist. Should + * be [0, 1]. + * + * Generated from protobuf field float allowlist_coverage = 1; + * @param float $var + * @return $this + */ + public function setAllowlistCoverage($var) + { + GPBUtil::checkFloat($var); + $this->allowlist_coverage = $var; + + return $this; + } + + /** + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics top_n_metrics = 2; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics> + */ + public function getTopNMetrics() + { + return $this->top_n_metrics; + } + + /** + * Metrics of top n smart replies, sorted by [TopNMetric.n][]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics top_n_metrics = 2; + * @param \Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics[] $var + * @return $this + */ + public function setTopNMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics::class); + $this->top_n_metrics = $arr; + + return $this; + } + + /** + * Total number of conversations used to generate this metric. + * + * Generated from protobuf field int64 conversation_count = 3; + * @return int|string + */ + public function getConversationCount() + { + return $this->conversation_count; + } + + /** + * Total number of conversations used to generate this metric. + * + * Generated from protobuf field int64 conversation_count = 3; + * @param int|string $var + * @return $this + */ + public function setConversationCount($var) + { + GPBUtil::checkInt64($var); + $this->conversation_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php new file mode 100644 index 000000000000..799cf73e148e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php @@ -0,0 +1,121 @@ +google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics + */ +class TopNMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * + * Generated from protobuf field int32 n = 1; + */ + protected $n = 0; + /** + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $n + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * @type float $recall + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * + * Generated from protobuf field int32 n = 1; + * @return int + */ + public function getN() + { + return $this->n; + } + + /** + * Number of retrieved smart replies. For example, when `n` is 3, this + * evaluation contains metrics for when Dialogflow retrieves 3 smart replies + * with the model. + * + * Generated from protobuf field int32 n = 1; + * @param int $var + * @return $this + */ + public function setN($var) + { + GPBUtil::checkInt32($var); + $this->n = $var; + + return $this; + } + + /** + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Defined as `number of queries whose top n smart replies have at least one + * similar (token match similarity above the defined threshold) reply as the + * real reply` divided by `number of queries with at least one smart reply`. + * Value ranges from 0.0 to 1.0 inclusive. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyModelMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyModelMetadata.php new file mode 100644 index 000000000000..e25d9a744f81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyModelMetadata.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.SmartReplyModelMetadata + */ +class SmartReplyModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $training_model_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $training_model_type + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTrainingModelType() + { + return $this->training_model_type; + } + + /** + * Optional. Type of the smart reply model. If not provided, model_type is + * used. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.ModelType training_model_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTrainingModelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ConversationModel\ModelType::class); + $this->training_model_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php new file mode 100644 index 000000000000..7fc3ae95d2e2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php @@ -0,0 +1,162 @@ +google.cloud.dialogflow.v2.SpeechContext + */ +class SpeechContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $phrases; + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $phrases + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * @type float $boost + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getPhrases() + { + return $this->phrases; + } + + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setPhrases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrases = $arr; + + return $this; + } + + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php new file mode 100644 index 000000000000..46aefc36fea5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php @@ -0,0 +1,92 @@ +google.cloud.dialogflow.v2.SpeechModelVariant + */ +class SpeechModelVariant +{ + /** + * No model variant specified. In this case Dialogflow defaults to + * USE_BEST_AVAILABLE. + * + * Generated from protobuf enum SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + */ + const SPEECH_MODEL_VARIANT_UNSPECIFIED = 0; + /** + * Use the best available variant of the [Speech model][model] that the caller + * is eligible for. + * Please see the [Dialogflow + * docs](https://cloud.google.com/dialogflow/docs/data-logging) for + * how to make your project eligible for enhanced models. + * + * Generated from protobuf enum USE_BEST_AVAILABLE = 1; + */ + const USE_BEST_AVAILABLE = 1; + /** + * Use standard model variant even if an enhanced model is available. See the + * [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + * for details about enhanced models. + * + * Generated from protobuf enum USE_STANDARD = 2; + */ + const USE_STANDARD = 2; + /** + * Use an enhanced model variant: + * * If an enhanced variant does not exist for the given + * [model][google.cloud.dialogflow.v2.InputAudioConfig.model] and request + * language, Dialogflow falls back to the standard variant. + * The [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + * describes which models have enhanced variants. + * * If the API caller isn't eligible for enhanced models, Dialogflow returns + * an error. Please see the [Dialogflow + * docs](https://cloud.google.com/dialogflow/docs/data-logging) + * for how to make your project eligible. + * + * Generated from protobuf enum USE_ENHANCED = 3; + */ + const USE_ENHANCED = 3; + + private static $valueToName = [ + self::SPEECH_MODEL_VARIANT_UNSPECIFIED => 'SPEECH_MODEL_VARIANT_UNSPECIFIED', + self::USE_BEST_AVAILABLE => 'USE_BEST_AVAILABLE', + self::USE_STANDARD => 'USE_STANDARD', + self::USE_ENHANCED => 'USE_ENHANCED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php new file mode 100644 index 000000000000..2123e62301cf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php @@ -0,0 +1,486 @@ +google.cloud.dialogflow.v2.SpeechToTextConfig + */ +class SpeechToTextConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + */ + protected $speech_model_variant = 0; + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + */ + protected $model = ''; + /** + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * + * Generated from protobuf field repeated string phrase_sets = 4 [(.google.api.resource_reference) = { + */ + private $phrase_sets; + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + */ + protected $audio_encoding = 0; + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + */ + protected $sample_rate_hertz = 0; + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not specified, the default language configured at + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] is + * used. + * + * Generated from protobuf field string language_code = 8; + */ + protected $language_code = ''; + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + */ + protected $enable_word_info = false; + /** + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + */ + protected $use_timeout_based_endpointing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $speech_model_variant + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * @type string $model + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * @type string[] $phrase_sets + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * @type int $audio_encoding + * Audio encoding of the audio content to process. + * @type int $sample_rate_hertz + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * @type string $language_code + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not specified, the default language configured at + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] is + * used. + * @type bool $enable_word_info + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * @type bool $use_timeout_based_endpointing + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + * @return int + */ + public function getSpeechModelVariant() + { + return $this->speech_model_variant; + } + + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + * @param int $var + * @return $this + */ + public function setSpeechModelVariant($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); + $this->speech_model_variant = $var; + + return $this; + } + + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * + * Generated from protobuf field repeated string phrase_sets = 4 [(.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getPhraseSets() + { + return $this->phrase_sets; + } + + /** + * List of names of Cloud Speech phrase sets that are used for transcription. + * For phrase set limitations, please refer to [Cloud Speech API quotas and + * limits](https://cloud.google.com/speech-to-text/quotas#content). + * + * Generated from protobuf field repeated string phrase_sets = 4 [(.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setPhraseSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrase_sets = $arr; + + return $this; + } + + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not specified, the default language configured at + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] is + * used. + * + * Generated from protobuf field string language_code = 8; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * If not specified, the default language configured at + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] is + * used. + * + * Generated from protobuf field string language_code = 8; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + * @return bool + */ + public function getEnableWordInfo() + { + return $this->enable_word_info; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + * @param bool $var + * @return $this + */ + public function setEnableWordInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_word_info = $var; + + return $this; + } + + /** + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + * @return bool + */ + public function getUseTimeoutBasedEndpointing() + { + return $this->use_timeout_based_endpointing; + } + + /** + * Use timeout based endpointing, interpreting endpointer sensitivity as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + * @param bool $var + * @return $this + */ + public function setUseTimeoutBasedEndpointing($var) + { + GPBUtil::checkBool($var); + $this->use_timeout_based_endpointing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php new file mode 100644 index 000000000000..d8232ca453e2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php @@ -0,0 +1,225 @@ +google.cloud.dialogflow.v2.SpeechWordInfo + */ +class SpeechWordInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The word this info is for. + * + * Generated from protobuf field string word = 3; + */ + protected $word = ''; + /** + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_offset = 1; + */ + protected $start_offset = null; + /** + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_offset = 2; + */ + protected $end_offset = null; + /** + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $word + * The word this info is for. + * @type \Google\Protobuf\Duration $start_offset + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * @type \Google\Protobuf\Duration $end_offset + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * @type float $confidence + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * The word this info is for. + * + * Generated from protobuf field string word = 3; + * @return string + */ + public function getWord() + { + return $this->word; + } + + /** + * The word this info is for. + * + * Generated from protobuf field string word = 3; + * @param string $var + * @return $this + */ + public function setWord($var) + { + GPBUtil::checkString($var, True); + $this->word = $var; + + return $this; + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getStartOffset() + { + return $this->start_offset; + } + + public function hasStartOffset() + { + return isset($this->start_offset); + } + + public function clearStartOffset() + { + unset($this->start_offset); + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * start of the spoken word. This is an experimental feature and the accuracy + * of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setStartOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->start_offset = $var; + + return $this; + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getEndOffset() + { + return $this->end_offset; + } + + public function hasEndOffset() + { + return isset($this->end_offset); + } + + public function clearEndOffset() + { + unset($this->end_offset); + } + + /** + * Time offset relative to the beginning of the audio that corresponds to the + * end of the spoken word. This is an experimental feature and the accuracy of + * the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->end_offset = $var; + + return $this; + } + + /** + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The Speech confidence between 0.0 and 1.0 for this word. A higher number + * indicates an estimated greater likelihood that the recognized word is + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be fully stable over time for the same + * audio input. Users should also not rely on it to always be provided. + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SsmlVoiceGender.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SsmlVoiceGender.php new file mode 100644 index 000000000000..2508c1bc6e5e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SsmlVoiceGender.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.SsmlVoiceGender + */ +class SsmlVoiceGender +{ + /** + * An unspecified gender, which means that the client doesn't care which + * gender the selected voice will have. + * + * Generated from protobuf enum SSML_VOICE_GENDER_UNSPECIFIED = 0; + */ + const SSML_VOICE_GENDER_UNSPECIFIED = 0; + /** + * A male voice. + * + * Generated from protobuf enum SSML_VOICE_GENDER_MALE = 1; + */ + const SSML_VOICE_GENDER_MALE = 1; + /** + * A female voice. + * + * Generated from protobuf enum SSML_VOICE_GENDER_FEMALE = 2; + */ + const SSML_VOICE_GENDER_FEMALE = 2; + /** + * A gender-neutral voice. + * + * Generated from protobuf enum SSML_VOICE_GENDER_NEUTRAL = 3; + */ + const SSML_VOICE_GENDER_NEUTRAL = 3; + + private static $valueToName = [ + self::SSML_VOICE_GENDER_UNSPECIFIED => 'SSML_VOICE_GENDER_UNSPECIFIED', + self::SSML_VOICE_GENDER_MALE => 'SSML_VOICE_GENDER_MALE', + self::SSML_VOICE_GENDER_FEMALE => 'SSML_VOICE_GENDER_FEMALE', + self::SSML_VOICE_GENDER_NEUTRAL => 'SSML_VOICE_GENDER_NEUTRAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php new file mode 100644 index 000000000000..12b2325ab480 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php @@ -0,0 +1,739 @@ +google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + */ +class StreamingAnalyzeContentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $participant = ''; + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + protected $reply_audio_config = null; + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + protected $query_params = null; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + protected $assist_query_params = null; + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + */ + protected $cx_parameters = null; + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_extended_streaming = false; + /** + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_partial_automated_agent_reply = false; + /** + * Optional. If multiple uttereances are detected in the audio stream, process + * them individually instead of stitching them together to form a single + * utterance. + * + * Generated from protobuf field bool output_multiple_utterances = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_multiple_utterances = false; + /** + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * + * Generated from protobuf field bool enable_debugging_info = 19; + */ + protected $enable_debugging_info = false; + protected $config; + protected $input; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $participant + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @type \Google\Cloud\Dialogflow\V2\InputAudioConfig $audio_config + * Instructs the speech recognizer how to process the speech audio. + * @type \Google\Cloud\Dialogflow\V2\InputTextConfig $text_config + * The natural language text to be processed. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $reply_audio_config + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * @type string $input_audio + * The input audio content to be recognized. Must be sent if `audio_config` + * is set in the first message. The complete audio over all streaming + * messages must not exceed 1 minute. + * @type string $input_text + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * @type \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $input_dtmf + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * Parameters for a Dialogflow virtual-agent query. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * @type \Google\Protobuf\Struct $cx_parameters + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * @type bool $enable_extended_streaming + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * @type bool $enable_partial_automated_agent_reply + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * @type bool $output_multiple_utterances + * Optional. If multiple uttereances are detected in the audio stream, process + * them individually instead of stitching them together to form a single + * utterance. + * @type bool $enable_debugging_info + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * @return \Google\Cloud\Dialogflow\V2\InputAudioConfig|null + */ + public function getAudioConfig() + { + return $this->readOneof(2); + } + + public function hasAudioConfig() + { + return $this->hasOneof(2); + } + + /** + * Instructs the speech recognizer how to process the speech audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * @param \Google\Cloud\Dialogflow\V2\InputAudioConfig $var + * @return $this + */ + public function setAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputAudioConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * @return \Google\Cloud\Dialogflow\V2\InputTextConfig|null + */ + public function getTextConfig() + { + return $this->readOneof(3); + } + + public function hasTextConfig() + { + return $this->hasOneof(3); + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * @param \Google\Cloud\Dialogflow\V2\InputTextConfig $var + * @return $this + */ + public function setTextConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputTextConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getReplyAudioConfig() + { + return $this->reply_audio_config; + } + + public function hasReplyAudioConfig() + { + return isset($this->reply_audio_config); + } + + public function clearReplyAudioConfig() + { + unset($this->reply_audio_config); + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setReplyAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->reply_audio_config = $var; + + return $this; + } + + /** + * The input audio content to be recognized. Must be sent if `audio_config` + * is set in the first message. The complete audio over all streaming + * messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 5; + * @return string + */ + public function getInputAudio() + { + return $this->readOneof(5); + } + + public function hasInputAudio() + { + return $this->hasOneof(5); + } + + /** + * The input audio content to be recognized. Must be sent if `audio_config` + * is set in the first message. The complete audio over all streaming + * messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 5; + * @param string $var + * @return $this + */ + public function setInputAudio($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * + * Generated from protobuf field string input_text = 6; + * @return string + */ + public function getInputText() + { + return $this->readOneof(6); + } + + public function hasInputText() + { + return $this->hasOneof(6); + } + + /** + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * + * Generated from protobuf field string input_text = 6; + * @param string $var + * @return $this + */ + public function setInputText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * @return \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents|null + */ + public function getInputDtmf() + { + return $this->readOneof(9); + } + + public function hasInputDtmf() + { + return $this->hasOneof(9); + } + + /** + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * @param \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $var + * @return $this + */ + public function setInputDtmf($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + * @return \Google\Protobuf\Struct|null + */ + public function getCxParameters() + { + return $this->cx_parameters; + } + + public function hasCxParameters() + { + return isset($this->cx_parameters); + } + + public function clearCxParameters() + { + unset($this->cx_parameters); + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCxParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->cx_parameters = $var; + + return $this; + } + + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableExtendedStreaming() + { + return $this->enable_extended_streaming; + } + + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation] + * for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableExtendedStreaming($var) + { + GPBUtil::checkBool($var); + $this->enable_extended_streaming = $var; + + return $this; + } + + /** + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnablePartialAutomatedAgentReply() + { + return $this->enable_partial_automated_agent_reply; + } + + /** + * Optional. Enable partial responses from Dialogflow CX agent. If this flag + * is not enabled, response stream still contains only one final response even + * if some `Fulfillment`s in Dialogflow CX agent have been configured to + * return partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnablePartialAutomatedAgentReply($var) + { + GPBUtil::checkBool($var); + $this->enable_partial_automated_agent_reply = $var; + + return $this; + } + + /** + * Optional. If multiple uttereances are detected in the audio stream, process + * them individually instead of stitching them together to form a single + * utterance. + * + * Generated from protobuf field bool output_multiple_utterances = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getOutputMultipleUtterances() + { + return $this->output_multiple_utterances; + } + + /** + * Optional. If multiple uttereances are detected in the audio stream, process + * them individually instead of stitching them together to form a single + * utterance. + * + * Generated from protobuf field bool output_multiple_utterances = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setOutputMultipleUtterances($var) + { + GPBUtil::checkBool($var); + $this->output_multiple_utterances = $var; + + return $this; + } + + /** + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * + * Generated from protobuf field bool enable_debugging_info = 19; + * @return bool + */ + public function getEnableDebuggingInfo() + { + return $this->enable_debugging_info; + } + + /** + * If true, `StreamingAnalyzeContentResponse.debugging_info` will get + * populated. + * + * Generated from protobuf field bool enable_debugging_info = 19; + * @param bool $var + * @return $this + */ + public function setEnableDebuggingInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_debugging_info = $var; + + return $this; + } + + /** + * @return string + */ + public function getConfig() + { + return $this->whichOneof("config"); + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php new file mode 100644 index 000000000000..dbb393f8ff75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php @@ -0,0 +1,537 @@ += 1) messages contain + * `human_agent_suggestion_results`, `end_user_suggestion_results` or + * `message`. + * + * Generated from protobuf message google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + */ +class StreamingAnalyzeContentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + protected $recognition_result = null; + /** + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * + * Generated from protobuf field string reply_text = 2; + */ + protected $reply_text = ''; + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + protected $reply_audio = null; + /** + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + protected $automated_agent_reply = null; + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6; + */ + protected $message = null; + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + */ + private $human_agent_suggestion_results; + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + */ + private $end_user_suggestion_results; + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + protected $dtmf_parameters = null; + /** + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 11; + */ + protected $debugging_info = null; + /** + * The name of the actual Cloud speech model used for speech recognition. + * + * Generated from protobuf field string speech_model = 13; + */ + protected $speech_model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $recognition_result + * The result of speech recognition. + * @type string $reply_text + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * @type \Google\Cloud\Dialogflow\V2\OutputAudio $reply_audio + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $automated_agent_reply + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * @type \Google\Cloud\Dialogflow\V2\Message $message + * Message analyzed by CCAI. + * @type \Google\Cloud\Dialogflow\V2\SuggestionResult[] $human_agent_suggestion_results + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * @type \Google\Cloud\Dialogflow\V2\SuggestionResult[] $end_user_suggestion_results + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * @type \Google\Cloud\Dialogflow\V2\DtmfParameters $dtmf_parameters + * Indicates the parameters of DTMF. + * @type \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $debugging_info + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * @type string $speech_model + * The name of the actual Cloud speech model used for speech recognition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * @return \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null + */ + public function getRecognitionResult() + { + return $this->recognition_result; + } + + public function hasRecognitionResult() + { + return isset($this->recognition_result); + } + + public function clearRecognitionResult() + { + unset($this->recognition_result); + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * @param \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $var + * @return $this + */ + public function setRecognitionResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult::class); + $this->recognition_result = $var; + + return $this; + } + + /** + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * + * Generated from protobuf field string reply_text = 2; + * @return string + */ + public function getReplyText() + { + return $this->reply_text; + } + + /** + * The output text content. + * This field is set if an automated agent responded with a text for the user. + * + * Generated from protobuf field string reply_text = 2; + * @param string $var + * @return $this + */ + public function setReplyText($var) + { + GPBUtil::checkString($var, True); + $this->reply_text = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * @return \Google\Cloud\Dialogflow\V2\OutputAudio|null + */ + public function getReplyAudio() + { + return $this->reply_audio; + } + + public function hasReplyAudio() + { + return isset($this->reply_audio); + } + + public function clearReplyAudio() + { + unset($this->reply_audio); + } + + /** + * The audio data bytes encoded as specified in the request. + * This field is set if: + * - The `reply_audio_config` field is specified in the request. + * - The automated agent, which this output comes from, responded with audio. + * In such case, the `reply_audio.config` field contains settings used to + * synthesize the speech. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * @param \Google\Cloud\Dialogflow\V2\OutputAudio $var + * @return $this + */ + public function setReplyAudio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudio::class); + $this->reply_audio = $var; + + return $this; + } + + /** + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * @return \Google\Cloud\Dialogflow\V2\AutomatedAgentReply|null + */ + public function getAutomatedAgentReply() + { + return $this->automated_agent_reply; + } + + public function hasAutomatedAgentReply() + { + return isset($this->automated_agent_reply); + } + + public function clearAutomatedAgentReply() + { + unset($this->automated_agent_reply); + } + + /** + * Note that in [AutomatedAgentReply.DetectIntentResponse][], + * [Sessions.DetectIntentResponse.output_audio][] + * and [Sessions.DetectIntentResponse.output_audio_config][] + * are always empty, use + * [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] + * instead. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * @param \Google\Cloud\Dialogflow\V2\AutomatedAgentReply $var + * @return $this + */ + public function setAutomatedAgentReply($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply::class); + $this->automated_agent_reply = $var; + + return $this; + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6; + * @return \Google\Cloud\Dialogflow\V2\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * Message analyzed by CCAI. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Message message = 6; + * @param \Google\Cloud\Dialogflow\V2\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Message::class); + $this->message = $var; + + return $this; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SuggestionResult> + */ + public function getHumanAgentSuggestionResults() + { + return $this->human_agent_suggestion_results; + } + + /** + * The suggestions for most recent human agent. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * @param \Google\Cloud\Dialogflow\V2\SuggestionResult[] $var + * @return $this + */ + public function setHumanAgentSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->human_agent_suggestion_results = $arr; + + return $this; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SuggestionResult> + */ + public function getEndUserSuggestionResults() + { + return $this->end_user_suggestion_results; + } + + /** + * The suggestions for end user. The order is the same as + * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] + * of + * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * @param \Google\Cloud\Dialogflow\V2\SuggestionResult[] $var + * @return $this + */ + public function setEndUserSuggestionResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestionResult::class); + $this->end_user_suggestion_results = $arr; + + return $this; + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * @return \Google\Cloud\Dialogflow\V2\DtmfParameters|null + */ + public function getDtmfParameters() + { + return $this->dtmf_parameters; + } + + public function hasDtmfParameters() + { + return isset($this->dtmf_parameters); + } + + public function clearDtmfParameters() + { + unset($this->dtmf_parameters); + } + + /** + * Indicates the parameters of DTMF. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * @param \Google\Cloud\Dialogflow\V2\DtmfParameters $var + * @return $this + */ + public function setDtmfParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DtmfParameters::class); + $this->dtmf_parameters = $var; + + return $this; + } + + /** + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 11; + * @return \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo|null + */ + public function getDebuggingInfo() + { + return $this->debugging_info; + } + + public function hasDebuggingInfo() + { + return isset($this->debugging_info); + } + + public function clearDebuggingInfo() + { + unset($this->debugging_info); + } + + /** + * Debugging info that would get populated when + * `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 11; + * @param \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $var + * @return $this + */ + public function setDebuggingInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo::class); + $this->debugging_info = $var; + + return $this; + } + + /** + * The name of the actual Cloud speech model used for speech recognition. + * + * Generated from protobuf field string speech_model = 13; + * @return string + */ + public function getSpeechModel() + { + return $this->speech_model; + } + + /** + * The name of the actual Cloud speech model used for speech recognition. + * + * Generated from protobuf field string speech_model = 13; + * @param string $var + * @return $this + */ + public function setSpeechModel($var) + { + GPBUtil::checkString($var, True); + $this->speech_model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php new file mode 100644 index 000000000000..660b3c526ea4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php @@ -0,0 +1,523 @@ +google.cloud.dialogflow.v2.StreamingDetectIntentRequest + */ +class StreamingDetectIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $session = ''; + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + */ + protected $query_params = null; + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query_input = null; + /** + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * + * Generated from protobuf field bool single_utterance = 4 [deprecated = true]; + * @deprecated + */ + protected $single_utterance = false; + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5; + */ + protected $output_audio_config = null; + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + */ + protected $output_audio_config_mask = null; + /** + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 6; + */ + protected $input_audio = ''; + /** + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * + * Generated from protobuf field bool enable_debugging_info = 8; + */ + protected $enable_debugging_info = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * The parameters of this query. + * @type \Google\Cloud\Dialogflow\V2\QueryInput $query_input + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * @type bool $single_utterance + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * @type \Google\Protobuf\FieldMask $output_audio_config_mask + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * @type string $input_audio + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * @type bool $enable_debugging_info + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * Required. The name of the session the query is sent to. + * Format of the session name: + * `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * Generated from protobuf field string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * The parameters of this query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\QueryInput|null + */ + public function getQueryInput() + { + return $this->query_input; + } + + public function hasQueryInput() + { + return isset($this->query_input); + } + + public function clearQueryInput() + { + unset($this->query_input); + } + + /** + * Required. The input specification. It can be set to: + * 1. an audio config which instructs the speech recognizer how to process + * the speech audio, + * 2. a conversational query in the form of text, or + * 3. an event that specifies which intent to trigger. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryInput query_input = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\QueryInput $var + * @return $this + */ + public function setQueryInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryInput::class); + $this->query_input = $var; + + return $this; + } + + /** + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * + * Generated from protobuf field bool single_utterance = 4 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getSingleUtterance() + { + if ($this->single_utterance !== false) { + @trigger_error('single_utterance is deprecated.', E_USER_DEPRECATED); + } + return $this->single_utterance; + } + + /** + * Please use + * [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] + * instead. If `false` (default), recognition does not cease until the client + * closes the stream. If `true`, the recognizer will detect a single spoken + * utterance in input audio. Recognition ceases when it detects the audio's + * voice has stopped or paused. In this case, once a detected intent is + * received, the client should close the stream and start a new request with a + * new stream as needed. This setting is ignored when `query_input` is a piece + * of text or an event. + * + * Generated from protobuf field bool single_utterance = 4 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setSingleUtterance($var) + { + @trigger_error('single_utterance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * Instructs the speech synthesizer how to generate the output + * audio. If this field is not set and agent-level speech synthesizer is not + * configured, no output audio is generated. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 5; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @return \Google\Protobuf\FieldMask|null + */ + public function getOutputAudioConfigMask() + { + return $this->output_audio_config_mask; + } + + public function hasOutputAudioConfigMask() + { + return isset($this->output_audio_config_mask); + } + + public function clearOutputAudioConfigMask() + { + unset($this->output_audio_config_mask); + } + + /** + * Mask for + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * indicating which settings in this request-level config should override + * speech synthesizer settings defined at agent-level. + * If unspecified or empty, + * [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] + * replaces the agent-level config in its entirety. + * + * Generated from protobuf field .google.protobuf.FieldMask output_audio_config_mask = 7; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setOutputAudioConfigMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->output_audio_config_mask = $var; + + return $this; + } + + /** + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 6; + * @return string + */ + public function getInputAudio() + { + return $this->input_audio; + } + + /** + * The input audio content to be recognized. Must be sent if + * `query_input` was set to a streaming input audio config. The complete audio + * over all streaming messages must not exceed 1 minute. + * + * Generated from protobuf field bytes input_audio = 6; + * @param string $var + * @return $this + */ + public function setInputAudio($var) + { + GPBUtil::checkString($var, False); + $this->input_audio = $var; + + return $this; + } + + /** + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * + * Generated from protobuf field bool enable_debugging_info = 8; + * @return bool + */ + public function getEnableDebuggingInfo() + { + return $this->enable_debugging_info; + } + + /** + * if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + * + * Generated from protobuf field bool enable_debugging_info = 8; + * @param bool $var + * @return $this + */ + public function setEnableDebuggingInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_debugging_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php new file mode 100644 index 000000000000..db992cd4688d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php @@ -0,0 +1,377 @@ +google.cloud.dialogflow.v2.StreamingDetectIntentResponse + */ +class StreamingDetectIntentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + */ + protected $response_id = ''; + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 2; + */ + protected $recognition_result = null; + /** + * The result of the conversational query or event processing. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 3; + */ + protected $query_result = null; + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 4; + */ + protected $webhook_status = null; + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 5; + */ + protected $output_audio = ''; + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + */ + protected $output_audio_config = null; + /** + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 8; + */ + protected $debugging_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $response_id + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * @type \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $recognition_result + * The result of speech recognition. + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * The result of the conversational query or event processing. + * @type \Google\Rpc\Status $webhook_status + * Specifies the status of the webhook request. + * @type string $output_audio + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $output_audio_config + * The config used by the speech synthesizer to generate the output audio. + * @type \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $debugging_info + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @return string + */ + public function getResponseId() + { + return $this->response_id; + } + + /** + * The unique identifier of the response. It can be used to + * locate a response in the training example set or for reporting issues. + * + * Generated from protobuf field string response_id = 1; + * @param string $var + * @return $this + */ + public function setResponseId($var) + { + GPBUtil::checkString($var, True); + $this->response_id = $var; + + return $this; + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 2; + * @return \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult|null + */ + public function getRecognitionResult() + { + return $this->recognition_result; + } + + public function hasRecognitionResult() + { + return isset($this->recognition_result); + } + + public function clearRecognitionResult() + { + unset($this->recognition_result); + } + + /** + * The result of speech recognition. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 2; + * @param \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult $var + * @return $this + */ + public function setRecognitionResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult::class); + $this->recognition_result = $var; + + return $this; + } + + /** + * The result of the conversational query or event processing. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 3; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->query_result; + } + + public function hasQueryResult() + { + return isset($this->query_result); + } + + public function clearQueryResult() + { + unset($this->query_result); + } + + /** + * The result of the conversational query or event processing. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 3; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->query_result = $var; + + return $this; + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 4; + * @return \Google\Rpc\Status|null + */ + public function getWebhookStatus() + { + return $this->webhook_status; + } + + public function hasWebhookStatus() + { + return isset($this->webhook_status); + } + + public function clearWebhookStatus() + { + unset($this->webhook_status); + } + + /** + * Specifies the status of the webhook request. + * + * Generated from protobuf field .google.rpc.Status webhook_status = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setWebhookStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->webhook_status = $var; + + return $this; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 5; + * @return string + */ + public function getOutputAudio() + { + return $this->output_audio; + } + + /** + * The audio data bytes encoded as specified in the request. + * Note: The output audio is generated based on the values of default platform + * text responses found in the `query_result.fulfillment_messages` field. If + * multiple default text responses exist, they will be concatenated when + * generating audio. If no default platform text responses exist, the + * generated audio content will be empty. + * In some scenarios, multiple output audio fields may be present in the + * response structure. In these cases, only the top-most-level audio output + * has content. + * + * Generated from protobuf field bytes output_audio = 5; + * @param string $var + * @return $this + */ + public function setOutputAudio($var) + { + GPBUtil::checkString($var, False); + $this->output_audio = $var; + + return $this; + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getOutputAudioConfig() + { + return $this->output_audio_config; + } + + public function hasOutputAudioConfig() + { + return isset($this->output_audio_config); + } + + public function clearOutputAudioConfig() + { + unset($this->output_audio_config); + } + + /** + * The config used by the speech synthesizer to generate the output audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig output_audio_config = 6; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setOutputAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->output_audio_config = $var; + + return $this; + } + + /** + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 8; + * @return \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo|null + */ + public function getDebuggingInfo() + { + return $this->debugging_info; + } + + public function hasDebuggingInfo() + { + return isset($this->debugging_info); + } + + public function clearDebuggingInfo() + { + unset($this->debugging_info); + } + + /** + * Debugging info that would get populated when + * [StreamingDetectIntentRequest.enable_debugging_info][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.enable_debugging_info] + * is set to true. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.CloudConversationDebuggingInfo debugging_info = 8; + * @param \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo $var + * @return $this + */ + public function setDebuggingInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\CloudConversationDebuggingInfo::class); + $this->debugging_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php new file mode 100644 index 000000000000..538c93d77223 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php @@ -0,0 +1,366 @@ +google.cloud.dialogflow.v2.StreamingRecognitionResult + */ +class StreamingRecognitionResult extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the result message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1; + */ + protected $message_type = 0; + /** + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field string transcript = 2; + */ + protected $transcript = ''; + /** + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field bool is_final = 3; + */ + protected $is_final = false; + /** + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + /** + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechWordInfo speech_word_info = 7; + */ + private $speech_word_info; + /** + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field .google.protobuf.Duration speech_end_offset = 8; + */ + protected $speech_end_offset = null; + /** + * Detected language code for the transcript. + * + * Generated from protobuf field string language_code = 10; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $message_type + * Type of the result message. + * @type string $transcript + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * @type bool $is_final + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * @type float $confidence + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * @type \Google\Cloud\Dialogflow\V2\SpeechWordInfo[] $speech_word_info + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * @type \Google\Protobuf\Duration $speech_end_offset + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * @type string $language_code + * Detected language code for the transcript. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Type of the result message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1; + * @return int + */ + public function getMessageType() + { + return $this->message_type; + } + + /** + * Type of the result message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType message_type = 1; + * @param int $var + * @return $this + */ + public function setMessageType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult\MessageType::class); + $this->message_type = $var; + + return $this; + } + + /** + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field string transcript = 2; + * @return string + */ + public function getTranscript() + { + return $this->transcript; + } + + /** + * Transcript text representing the words that the user spoke. + * Populated if and only if `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field string transcript = 2; + * @param string $var + * @return $this + */ + public function setTranscript($var) + { + GPBUtil::checkString($var, True); + $this->transcript = $var; + + return $this; + } + + /** + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field bool is_final = 3; + * @return bool + */ + public function getIsFinal() + { + return $this->is_final; + } + + /** + * If `false`, the `StreamingRecognitionResult` represents an + * interim result that may change. If `true`, the recognizer will not return + * any further hypotheses about this piece of the audio. May only be populated + * for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field bool is_final = 3; + * @param bool $var + * @return $this + */ + public function setIsFinal($var) + { + GPBUtil::checkBool($var); + $this->is_final = $var; + + return $this; + } + + /** + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The Speech confidence between 0.0 and 1.0 for the current portion of audio. + * A higher number indicates an estimated greater likelihood that the + * recognized words are correct. The default of 0.0 is a sentinel value + * indicating that confidence was not set. + * This field is typically only provided if `is_final` is true and you should + * not rely on it being accurate or even set. + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechWordInfo speech_word_info = 7; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SpeechWordInfo> + */ + public function getSpeechWordInfo() + { + return $this->speech_word_info; + } + + /** + * Word-specific information for the words recognized by Speech in + * [transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript]. + * Populated if and only if `message_type` = `TRANSCRIPT` and + * [InputAudioConfig.enable_word_info] is set. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechWordInfo speech_word_info = 7; + * @param \Google\Cloud\Dialogflow\V2\SpeechWordInfo[] $var + * @return $this + */ + public function setSpeechWordInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SpeechWordInfo::class); + $this->speech_word_info = $arr; + + return $this; + } + + /** + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field .google.protobuf.Duration speech_end_offset = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getSpeechEndOffset() + { + return $this->speech_end_offset; + } + + public function hasSpeechEndOffset() + { + return isset($this->speech_end_offset); + } + + public function clearSpeechEndOffset() + { + unset($this->speech_end_offset); + } + + /** + * Time offset of the end of this Speech recognition result relative to the + * beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + * + * Generated from protobuf field .google.protobuf.Duration speech_end_offset = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSpeechEndOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->speech_end_offset = $var; + + return $this; + } + + /** + * Detected language code for the transcript. + * + * Generated from protobuf field string language_code = 10; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Detected language code for the transcript. + * + * Generated from protobuf field string language_code = 10; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php new file mode 100644 index 000000000000..d62c45eb6020 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType + */ +class MessageType +{ + /** + * Not specified. Should never be used. + * + * Generated from protobuf enum MESSAGE_TYPE_UNSPECIFIED = 0; + */ + const MESSAGE_TYPE_UNSPECIFIED = 0; + /** + * Message contains a (possibly partial) transcript. + * + * Generated from protobuf enum TRANSCRIPT = 1; + */ + const TRANSCRIPT = 1; + /** + * This event indicates that the server has detected the end of the user's + * speech utterance and expects no additional inputs. + * Therefore, the server will not process additional audio (although it may + * subsequently return additional results). The client should stop sending + * additional audio data, half-close the gRPC connection, and wait for any + * additional results until the server closes the gRPC connection. This + * message is only sent if `single_utterance` was set to `true`, and is not + * used otherwise. + * + * Generated from protobuf enum END_OF_SINGLE_UTTERANCE = 2; + */ + const END_OF_SINGLE_UTTERANCE = 2; + + private static $valueToName = [ + self::MESSAGE_TYPE_UNSPECIFIED => 'MESSAGE_TYPE_UNSPECIFIED', + self::TRANSCRIPT => 'TRANSCRIPT', + self::END_OF_SINGLE_UTTERANCE => 'END_OF_SINGLE_UTTERANCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesRequest.php new file mode 100644 index 000000000000..e3ea72e0455c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesRequest.php @@ -0,0 +1,228 @@ +google.cloud.dialogflow.v2.SuggestArticlesRequest + */ +class SuggestArticlesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + */ + protected $assist_query_params = null; + + /** + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] + * to use as context when compiling the suggestion. By default 20 and at + * most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesResponse.php new file mode 100644 index 000000000000..d844195d7b6b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesResponse.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.SuggestArticlesResponse + */ +class SuggestArticlesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Articles ordered by score in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ArticleAnswer article_answers = 1; + */ + private $article_answers; + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ArticleAnswer[] $article_answers + * Articles ordered by score in descending order. + * @type string $latest_message + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Articles ordered by score in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ArticleAnswer article_answers = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ArticleAnswer> + */ + public function getArticleAnswers() + { + return $this->article_answers; + } + + /** + * Articles ordered by score in descending order. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ArticleAnswer article_answers = 1; + * @param \Google\Cloud\Dialogflow\V2\ArticleAnswer[] $var + * @return $this + */ + public function setArticleAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ArticleAnswer::class); + $this->article_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php new file mode 100644 index 000000000000..40ca2a78c41d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php @@ -0,0 +1,232 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryRequest + */ +class SuggestConversationSummaryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $assist_query_params = null; + + /** + * @param string $conversation Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryRequest + * + * @experimental + */ + public static function build(string $conversation): self + { + return (new self()) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * @type string $latest_message + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php new file mode 100644 index 000000000000..7be2be597966 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php @@ -0,0 +1,178 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryResponse + */ +class SuggestConversationSummaryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary summary = 1; + */ + protected $summary = null; + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary $summary + * Generated summary. + * @type string $latest_message + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary summary = 1; + * @return \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary|null + */ + public function getSummary() + { + return $this->summary; + } + + public function hasSummary() + { + return isset($this->summary); + } + + public function clearSummary() + { + unset($this->summary); + } + + /** + * Generated summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary summary = 1; + * @param \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary::class); + $this->summary = $var; + + return $this; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used as context for + * compiling suggestion. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.latest_message] + * used to compile the suggestion. It may be smaller than the + * [SuggestConversationSummaryRequest.context_size][google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.context_size] + * field in the request if there weren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php new file mode 100644 index 000000000000..d2b8e9d4ff80 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php @@ -0,0 +1,223 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary + */ +class Summary extends \Google\Protobuf\Internal\Message +{ + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + */ + private $text_sections; + /** + * Same as text_sections, but in an order that is consistent with the order + * of the sections in the generator. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection sorted_text_sections = 6; + */ + private $sorted_text_sections; + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + */ + protected $answer_record = ''; + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The summary content that is concatenated into one string. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * @type \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary\SummarySection[] $sorted_text_sections + * Same as text_sections, but in an order that is consistent with the order + * of the sections in the generator. + * @type string $answer_record + * The name of the answer record. Format: + * "projects//answerRecords/" + * @type string $baseline_model_version + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + + /** + * Same as text_sections, but in an order that is consistent with the order + * of the sections in the generator. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection sorted_text_sections = 6; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary\SummarySection> + */ + public function getSortedTextSections() + { + return $this->sorted_text_sections; + } + + /** + * Same as text_sections, but in an order that is consistent with the order + * of the sections in the generator. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection sorted_text_sections = 6; + * @param \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary\SummarySection[] $var + * @return $this + */ + public function setSortedTextSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse\Summary\SummarySection::class); + $this->sorted_text_sections = $arr; + + return $this; + } + + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary/SummarySection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary/SummarySection.php new file mode 100644 index 000000000000..04fc75afd150 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary/SummarySection.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection + */ +class SummarySection extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $section = ''; + /** + * Output only. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $summary = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section + * Output only. Name of the section. + * @type string $summary + * Output only. Summary text for the section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Output only. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Output only. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * Output only. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkString($var, True); + $this->summary = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersRequest.php new file mode 100644 index 000000000000..9e8b0816f094 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersRequest.php @@ -0,0 +1,224 @@ +google.cloud.dialogflow.v2.SuggestFaqAnswersRequest + */ +class SuggestFaqAnswersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + */ + protected $assist_query_params = null; + + /** + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 4; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersResponse.php new file mode 100644 index 000000000000..ed7f924d6793 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersResponse.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.SuggestFaqAnswersResponse + */ +class SuggestFaqAnswersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Answers extracted from FAQ documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FaqAnswer faq_answers = 1; + */ + private $faq_answers; + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\FaqAnswer[] $faq_answers + * Answers extracted from FAQ documents. + * @type string $latest_message + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Answers extracted from FAQ documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FaqAnswer faq_answers = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\FaqAnswer> + */ + public function getFaqAnswers() + { + return $this->faq_answers; + } + + /** + * Answers extracted from FAQ documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FaqAnswer faq_answers = 1; + * @param \Google\Cloud\Dialogflow\V2\FaqAnswer[] $var + * @return $this + */ + public function setFaqAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\FaqAnswer::class); + $this->faq_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php new file mode 100644 index 000000000000..1d5e29c869c9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php @@ -0,0 +1,214 @@ +google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest + */ +class SuggestKnowledgeAssistRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $previous_suggested_query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * @type string $previous_suggested_query + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPreviousSuggestedQuery() + { + return $this->previous_suggested_query; + } + + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is reasonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPreviousSuggestedQuery($var) + { + GPBUtil::checkString($var, True); + $this->previous_suggested_query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php new file mode 100644 index 000000000000..2bb1954320b6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php @@ -0,0 +1,212 @@ +google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse + */ +class SuggestKnowledgeAssistResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $knowledge_assist_answer = null; + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + /** + * Optional. The list of additional suggested queries based on the context. + * This is used for the cases when we want to generate multiple queries + * for a single request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult additional_suggested_query_results = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $additional_suggested_query_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $knowledge_assist_answer + * Output only. Knowledge Assist suggestion. + * @type string $latest_message + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\AdditionalSuggestedQueryResult[] $additional_suggested_query_results + * Optional. The list of additional suggested queries based on the context. + * This is used for the cases when we want to generate multiple queries + * for a single request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer|null + */ + public function getKnowledgeAssistAnswer() + { + return $this->knowledge_assist_answer; + } + + public function hasKnowledgeAssistAnswer() + { + return isset($this->knowledge_assist_answer); + } + + public function clearKnowledgeAssistAnswer() + { + unset($this->knowledge_assist_answer); + } + + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $var + * @return $this + */ + public function setKnowledgeAssistAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer::class); + $this->knowledge_assist_answer = $var; + + return $this; + } + + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. The list of additional suggested queries based on the context. + * This is used for the cases when we want to generate multiple queries + * for a single request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult additional_suggested_query_results = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\AdditionalSuggestedQueryResult> + */ + public function getAdditionalSuggestedQueryResults() + { + return $this->additional_suggested_query_results; + } + + /** + * Optional. The list of additional suggested queries based on the context. + * This is used for the cases when we want to generate multiple queries + * for a single request. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult additional_suggested_query_results = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\AdditionalSuggestedQueryResult[] $var + * @return $this + */ + public function setAdditionalSuggestedQueryResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\AdditionalSuggestedQueryResult::class); + $this->additional_suggested_query_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php new file mode 100644 index 000000000000..92022733fc20 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php @@ -0,0 +1,232 @@ +google.cloud.dialogflow.v2.SuggestSmartRepliesRequest + */ +class SuggestSmartRepliesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput current_text_input = 4; + */ + protected $current_text_input = null; + /** + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $current_text_input + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * @type string $latest_message + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput current_text_input = 4; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getCurrentTextInput() + { + return $this->current_text_input; + } + + public function hasCurrentTextInput() + { + return isset($this->current_text_input); + } + + public function clearCurrentTextInput() + { + unset($this->current_text_input); + } + + /** + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput current_text_input = 4; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setCurrentTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->current_text_input = $var; + + return $this; + } + + /** + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php new file mode 100644 index 000000000000..97e1e0bd32bb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php @@ -0,0 +1,176 @@ +google.cloud.dialogflow.v2.SuggestSmartRepliesResponse + */ +class SuggestSmartRepliesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyAnswer smart_reply_answers = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $smart_reply_answers; + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SmartReplyAnswer[] $smart_reply_answers + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * @type string $latest_message + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyAnswer smart_reply_answers = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer> + */ + public function getSmartReplyAnswers() + { + return $this->smart_reply_answers; + } + + /** + * Output only. Multiple reply options provided by smart reply service. The + * order is based on the rank of the model prediction. + * The maximum number of the returned replies is set in SmartReplyConfig. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SmartReplyAnswer smart_reply_answers = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SmartReplyAnswer[] $var + * @return $this + */ + public function setSmartReplyAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SmartReplyAnswer::class); + $this->smart_reply_answers = $arr; + + return $this; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile + * suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestSmartRepliesResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2.SuggestSmartRepliesRequest.context_size] + * field in the request if there aren't that many messages in the + * conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionDedupingConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionDedupingConfig.php new file mode 100644 index 000000000000..48988f4fce45 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionDedupingConfig.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.SuggestionDedupingConfig + */ +class SuggestionDedupingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to enable suggestion deduping. + * + * Generated from protobuf field bool enable_deduping = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_deduping = false; + /** + * Optional. The threshold for similarity between two suggestions. + * Acceptable value is [0.0, 1.0], default to 0.8 + * + * Generated from protobuf field float similarity_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $similarity_threshold = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_deduping + * Optional. Whether to enable suggestion deduping. + * @type float $similarity_threshold + * Optional. The threshold for similarity between two suggestions. + * Acceptable value is [0.0, 1.0], default to 0.8 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to enable suggestion deduping. + * + * Generated from protobuf field bool enable_deduping = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableDeduping() + { + return $this->enable_deduping; + } + + /** + * Optional. Whether to enable suggestion deduping. + * + * Generated from protobuf field bool enable_deduping = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableDeduping($var) + { + GPBUtil::checkBool($var); + $this->enable_deduping = $var; + + return $this; + } + + /** + * Optional. The threshold for similarity between two suggestions. + * Acceptable value is [0.0, 1.0], default to 0.8 + * + * Generated from protobuf field float similarity_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSimilarityThreshold() + { + return $this->similarity_threshold; + } + + /** + * Optional. The threshold for similarity between two suggestions. + * Acceptable value is [0.0, 1.0], default to 0.8 + * + * Generated from protobuf field float similarity_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSimilarityThreshold($var) + { + GPBUtil::checkFloat($var); + $this->similarity_threshold = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php new file mode 100644 index 000000000000..601d1432bbfb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.SuggestionFeature + */ +class SuggestionFeature extends \Google\Protobuf\Internal\Message +{ + /** + * Type of Human Agent Assistant API feature to request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type type = 1; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Type of Human Agent Assistant API feature to request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Type of Human Agent Assistant API feature to request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of Human Agent Assistant API feature to request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php new file mode 100644 index 000000000000..5e089c15f631 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php @@ -0,0 +1,89 @@ +google.cloud.dialogflow.v2.SuggestionFeature.Type + */ +class Type +{ + /** + * Unspecified feature type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Run article suggestion model for chat. + * + * Generated from protobuf enum ARTICLE_SUGGESTION = 1; + */ + const ARTICLE_SUGGESTION = 1; + /** + * Run FAQ model for chat. + * + * Generated from protobuf enum FAQ = 2; + */ + const FAQ = 2; + /** + * Run smart reply model for chat. + * + * Generated from protobuf enum SMART_REPLY = 3; + */ + const SMART_REPLY = 3; + /** + * Run conversation summarization model for chat. + * + * Generated from protobuf enum CONVERSATION_SUMMARIZATION = 8; + */ + const CONVERSATION_SUMMARIZATION = 8; + /** + * Run knowledge search with text input from agent or text generated query. + * + * Generated from protobuf enum KNOWLEDGE_SEARCH = 14; + */ + const KNOWLEDGE_SEARCH = 14; + /** + * Run knowledge assist with automatic query generation. + * + * Generated from protobuf enum KNOWLEDGE_ASSIST = 15; + */ + const KNOWLEDGE_ASSIST = 15; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', + self::FAQ => 'FAQ', + self::SMART_REPLY => 'SMART_REPLY', + self::CONVERSATION_SUMMARIZATION => 'CONVERSATION_SUMMARIZATION', + self::KNOWLEDGE_SEARCH => 'KNOWLEDGE_SEARCH', + self::KNOWLEDGE_ASSIST => 'KNOWLEDGE_ASSIST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php new file mode 100644 index 000000000000..5df44a0198f9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.SuggestionInput + */ +class SuggestionInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Format: `projects//locations//answerRecords/` + * The answer record associated with the tool call. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_record = ''; + /** + * Optional. Parameters to be used for the tool call. If not provided, the + * tool will be called without any parameters. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parameters = null; + /** + * Optional. The type of action to take with the tool. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput.Action action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $action = 0; + /** + * Optional. Time when the current suggest input is sent. For tool calls, this + * timestamp (along with the answer record) will be included in the + * corresponding tool call result so that it can be identified. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $send_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_record + * Required. Format: `projects//locations//answerRecords/` + * The answer record associated with the tool call. + * @type \Google\Protobuf\Struct $parameters + * Optional. Parameters to be used for the tool call. If not provided, the + * tool will be called without any parameters. + * @type int $action + * Optional. The type of action to take with the tool. + * @type \Google\Protobuf\Timestamp $send_time + * Optional. Time when the current suggest input is sent. For tool calls, this + * timestamp (along with the answer record) will be included in the + * corresponding tool call result so that it can be identified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. Format: `projects//locations//answerRecords/` + * The answer record associated with the tool call. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Required. Format: `projects//locations//answerRecords/` + * The answer record associated with the tool call. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * Optional. Parameters to be used for the tool call. If not provided, the + * tool will be called without any parameters. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * Optional. Parameters to be used for the tool call. If not provided, the + * tool will be called without any parameters. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * Optional. The type of action to take with the tool. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput.Action action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAction() + { + return $this->action; + } + + /** + * Optional. The type of action to take with the tool. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput.Action action = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SuggestionInput\Action::class); + $this->action = $var; + + return $this; + } + + /** + * Optional. Time when the current suggest input is sent. For tool calls, this + * timestamp (along with the answer record) will be included in the + * corresponding tool call result so that it can be identified. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSendTime() + { + return $this->send_time; + } + + public function hasSendTime() + { + return isset($this->send_time); + } + + public function clearSendTime() + { + unset($this->send_time); + } + + /** + * Optional. Time when the current suggest input is sent. For tool calls, this + * timestamp (along with the answer record) will be included in the + * corresponding tool call result so that it can be identified. + * + * Generated from protobuf field .google.protobuf.Timestamp send_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSendTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->send_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput/Action.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput/Action.php new file mode 100644 index 000000000000..edbf33c0cf1b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput/Action.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.SuggestionInput.Action + */ +class Action +{ + /** + * Action not specified. + * + * Generated from protobuf enum ACTION_UNSPECIFIED = 0; + */ + const ACTION_UNSPECIFIED = 0; + /** + * Indicates the user chooses to not make the tool call. It + * is only applicable to tool calls that are waiting for user + * confirmation. + * + * Generated from protobuf enum CANCEL = 1; + */ + const CANCEL = 1; + /** + * Makes the tool call with provided parameters. This action is intended + * for tool calls that only read but not write data. + * + * Generated from protobuf enum REVISE = 2; + */ + const REVISE = 2; + /** + * Makes the tool call with provided parameters. This action is intended + * for tool calls that may write data. + * + * Generated from protobuf enum CONFIRM = 3; + */ + const CONFIRM = 3; + + private static $valueToName = [ + self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', + self::CANCEL => 'CANCEL', + self::REVISE => 'REVISE', + self::CONFIRM => 'CONFIRM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php new file mode 100644 index 000000000000..b58eff2726a3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php @@ -0,0 +1,249 @@ +google.cloud.dialogflow.v2.SuggestionResult + */ +class SuggestionResult extends \Google\Protobuf\Internal\Message +{ + protected $suggestion_response; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $error + * Error status if the request failed. + * @type \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $suggest_articles_response + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * @type \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $suggest_knowledge_assist_response + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * @type \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $suggest_faq_answers_response + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * @type \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $suggest_smart_replies_response + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * @type \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse $generate_suggestions_response + * Suggestions generated using generators triggered by customer or agent + * messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Error status if the request failed. + * + * Generated from protobuf field .google.rpc.Status error = 1; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(1); + } + + public function hasError() + { + return $this->hasOneof(1); + } + + /** + * Error status if the request failed. + * + * Generated from protobuf field .google.rpc.Status error = 1; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; + * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse|null + */ + public function getSuggestArticlesResponse() + { + return $this->readOneof(2); + } + + public function hasSuggestArticlesResponse() + { + return $this->hasOneof(2); + } + + /** + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; + * @param \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $var + * @return $this + */ + public function setSuggestArticlesResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; + * @return \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse|null + */ + public function getSuggestKnowledgeAssistResponse() + { + return $this->readOneof(8); + } + + public function hasSuggestKnowledgeAssistResponse() + { + return $this->hasOneof(8); + } + + /** + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; + * @param \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $var + * @return $this + */ + public function setSuggestKnowledgeAssistResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse|null + */ + public function getSuggestFaqAnswersResponse() + { + return $this->readOneof(3); + } + + public function hasSuggestFaqAnswersResponse() + { + return $this->hasOneof(3); + } + + /** + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + * @param \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $var + * @return $this + */ + public function setSuggestFaqAnswersResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse|null + */ + public function getSuggestSmartRepliesResponse() + { + return $this->readOneof(4); + } + + public function hasSuggestSmartRepliesResponse() + { + return $this->hasOneof(4); + } + + /** + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + * @param \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $var + * @return $this + */ + public function setSuggestSmartRepliesResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Suggestions generated using generators triggered by customer or agent + * messages. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateSuggestionsResponse generate_suggestions_response = 9; + * @return \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse|null + */ + public function getGenerateSuggestionsResponse() + { + return $this->readOneof(9); + } + + public function hasGenerateSuggestionsResponse() + { + return $this->hasOneof(9); + } + + /** + * Suggestions generated using generators triggered by customer or agent + * messages. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateSuggestionsResponse generate_suggestions_response = 9; + * @param \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse $var + * @return $this + */ + public function setGenerateSuggestionsResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getSuggestionResponse() + { + return $this->whichOneof("suggestion_response"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php new file mode 100644 index 000000000000..37df527c8619 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php @@ -0,0 +1,185 @@ +google.cloud.dialogflow.v2.SummarizationContext + */ +class SummarizationContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $summarization_sections; + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $few_shot_examples; + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version = ''; + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarizationSection[] $summarization_sections + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * @type \Google\Cloud\Dialogflow\V2\FewShotExample[] $few_shot_examples + * Optional. List of few shot examples. + * @type string $version + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * @type string $output_language_code + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationSection> + */ + public function getSummarizationSections() + { + return $this->summarization_sections; + } + + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationSection[] $var + * @return $this + */ + public function setSummarizationSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); + $this->summarization_sections = $arr; + + return $this; + } + + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\FewShotExample> + */ + public function getFewShotExamples() + { + return $this->few_shot_examples; + } + + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\FewShotExample[] $var + * @return $this + */ + public function setFewShotExamples($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\FewShotExample::class); + $this->few_shot_examples = $arr; + + return $this; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOutputLanguageCode() + { + return $this->output_language_code; + } + + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOutputLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->output_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics.php new file mode 100644 index 000000000000..d1c33c00539b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics.php @@ -0,0 +1,219 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics + */ +class SummarizationEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A list of evaluation results per conversation(&summary), + * metric and section. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResult summarization_evaluation_results = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $summarization_evaluation_results; + /** + * Output only. User bucket uri for merged evaluation score and aggregation + * score csv. + * + * Generated from protobuf field string summarization_evaluation_merged_results_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $summarization_evaluation_merged_results_uri = ''; + /** + * Output only. A list of aggregated(average) scores per metric section. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetric overall_metrics = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $overall_metrics; + /** + * Output only. Overall token per section. This is an aggregated(sum) result + * of input token of summary acorss all conversations that are selected for + * summarization evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken overall_section_tokens = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $overall_section_tokens; + /** + * Output only. List of conversation details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail conversation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conversation_details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SummarizationEvaluationResult[] $summarization_evaluation_results + * Output only. A list of evaluation results per conversation(&summary), + * metric and section. + * @type string $summarization_evaluation_merged_results_uri + * Output only. User bucket uri for merged evaluation score and aggregation + * score csv. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\OverallScoresByMetric[] $overall_metrics + * Output only. A list of aggregated(average) scores per metric section. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken[] $overall_section_tokens + * Output only. Overall token per section. This is an aggregated(sum) result + * of input token of summary acorss all conversations that are selected for + * summarization evaluation. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail[] $conversation_details + * Output only. List of conversation details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. A list of evaluation results per conversation(&summary), + * metric and section. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResult summarization_evaluation_results = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SummarizationEvaluationResult> + */ + public function getSummarizationEvaluationResults() + { + return $this->summarization_evaluation_results; + } + + /** + * Output only. A list of evaluation results per conversation(&summary), + * metric and section. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResult summarization_evaluation_results = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SummarizationEvaluationResult[] $var + * @return $this + */ + public function setSummarizationEvaluationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SummarizationEvaluationResult::class); + $this->summarization_evaluation_results = $arr; + + return $this; + } + + /** + * Output only. User bucket uri for merged evaluation score and aggregation + * score csv. + * + * Generated from protobuf field string summarization_evaluation_merged_results_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSummarizationEvaluationMergedResultsUri() + { + return $this->summarization_evaluation_merged_results_uri; + } + + /** + * Output only. User bucket uri for merged evaluation score and aggregation + * score csv. + * + * Generated from protobuf field string summarization_evaluation_merged_results_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSummarizationEvaluationMergedResultsUri($var) + { + GPBUtil::checkString($var, True); + $this->summarization_evaluation_merged_results_uri = $var; + + return $this; + } + + /** + * Output only. A list of aggregated(average) scores per metric section. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetric overall_metrics = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\OverallScoresByMetric> + */ + public function getOverallMetrics() + { + return $this->overall_metrics; + } + + /** + * Output only. A list of aggregated(average) scores per metric section. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetric overall_metrics = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\OverallScoresByMetric[] $var + * @return $this + */ + public function setOverallMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\OverallScoresByMetric::class); + $this->overall_metrics = $arr; + + return $this; + } + + /** + * Output only. Overall token per section. This is an aggregated(sum) result + * of input token of summary acorss all conversations that are selected for + * summarization evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken overall_section_tokens = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken> + */ + public function getOverallSectionTokens() + { + return $this->overall_section_tokens; + } + + /** + * Output only. Overall token per section. This is an aggregated(sum) result + * of input token of summary acorss all conversations that are selected for + * summarization evaluation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken overall_section_tokens = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken[] $var + * @return $this + */ + public function setOverallSectionTokens($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken::class); + $this->overall_section_tokens = $arr; + + return $this; + } + + /** + * Output only. List of conversation details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail conversation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail> + */ + public function getConversationDetails() + { + return $this->conversation_details; + } + + /** + * Output only. List of conversation details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail conversation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail[] $var + * @return $this + */ + public function setConversationDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail::class); + $this->conversation_details = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AccuracyDecomposition.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AccuracyDecomposition.php new file mode 100644 index 000000000000..4b5ae2f9425e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AccuracyDecomposition.php @@ -0,0 +1,145 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition + */ +class AccuracyDecomposition extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The breakdown point of the summary. + * + * Generated from protobuf field string point = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $point = ''; + /** + * Output only. The accuracy reasoning of the breakdown point. + * + * Generated from protobuf field string accuracy_reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $accuracy_reasoning = ''; + /** + * Output only. Whether the breakdown point is accurate or not. + * + * Generated from protobuf field optional bool is_accurate = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_accurate = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $point + * Output only. The breakdown point of the summary. + * @type string $accuracy_reasoning + * Output only. The accuracy reasoning of the breakdown point. + * @type bool $is_accurate + * Output only. Whether the breakdown point is accurate or not. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The breakdown point of the summary. + * + * Generated from protobuf field string point = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPoint() + { + return $this->point; + } + + /** + * Output only. The breakdown point of the summary. + * + * Generated from protobuf field string point = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPoint($var) + { + GPBUtil::checkString($var, True); + $this->point = $var; + + return $this; + } + + /** + * Output only. The accuracy reasoning of the breakdown point. + * + * Generated from protobuf field string accuracy_reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAccuracyReasoning() + { + return $this->accuracy_reasoning; + } + + /** + * Output only. The accuracy reasoning of the breakdown point. + * + * Generated from protobuf field string accuracy_reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAccuracyReasoning($var) + { + GPBUtil::checkString($var, True); + $this->accuracy_reasoning = $var; + + return $this; + } + + /** + * Output only. Whether the breakdown point is accurate or not. + * + * Generated from protobuf field optional bool is_accurate = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsAccurate() + { + return isset($this->is_accurate) ? $this->is_accurate : false; + } + + public function hasIsAccurate() + { + return isset($this->is_accurate); + } + + public function clearIsAccurate() + { + unset($this->is_accurate); + } + + /** + * Output only. Whether the breakdown point is accurate or not. + * + * Generated from protobuf field optional bool is_accurate = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsAccurate($var) + { + GPBUtil::checkBool($var); + $this->is_accurate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceDecomposition.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceDecomposition.php new file mode 100644 index 000000000000..6d90a2f7d781 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceDecomposition.php @@ -0,0 +1,136 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecomposition + */ +class AdherenceDecomposition extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The breakdown point of the given instructions. + * + * Generated from protobuf field string point = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $point = ''; + /** + * Output only. The adherence reasoning of the breakdown point. + * + * Generated from protobuf field string adherence_reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $adherence_reasoning = ''; + /** + * Output only. Whether the breakdown point is adherent or not. + * + * Generated from protobuf field bool is_adherent = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_adherent = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $point + * Output only. The breakdown point of the given instructions. + * @type string $adherence_reasoning + * Output only. The adherence reasoning of the breakdown point. + * @type bool $is_adherent + * Output only. Whether the breakdown point is adherent or not. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The breakdown point of the given instructions. + * + * Generated from protobuf field string point = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPoint() + { + return $this->point; + } + + /** + * Output only. The breakdown point of the given instructions. + * + * Generated from protobuf field string point = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPoint($var) + { + GPBUtil::checkString($var, True); + $this->point = $var; + + return $this; + } + + /** + * Output only. The adherence reasoning of the breakdown point. + * + * Generated from protobuf field string adherence_reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAdherenceReasoning() + { + return $this->adherence_reasoning; + } + + /** + * Output only. The adherence reasoning of the breakdown point. + * + * Generated from protobuf field string adherence_reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAdherenceReasoning($var) + { + GPBUtil::checkString($var, True); + $this->adherence_reasoning = $var; + + return $this; + } + + /** + * Output only. Whether the breakdown point is adherent or not. + * + * Generated from protobuf field bool is_adherent = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsAdherent() + { + return $this->is_adherent; + } + + /** + * Output only. Whether the breakdown point is adherent or not. + * + * Generated from protobuf field bool is_adherent = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsAdherent($var) + { + GPBUtil::checkBool($var); + $this->is_adherent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceRubric.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceRubric.php new file mode 100644 index 000000000000..09624f69a000 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/AdherenceRubric.php @@ -0,0 +1,154 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric + */ +class AdherenceRubric extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The question generated from instruction that used to + * evaluate summary. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $question = ''; + /** + * Output only. The reasoning of the rubric question is addressed or not. + * + * Generated from protobuf field string reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reasoning = ''; + /** + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * + * Generated from protobuf field optional bool is_addressed = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_addressed = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * Output only. The question generated from instruction that used to + * evaluate summary. + * @type string $reasoning + * Output only. The reasoning of the rubric question is addressed or not. + * @type bool $is_addressed + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The question generated from instruction that used to + * evaluate summary. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Output only. The question generated from instruction that used to + * evaluate summary. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Output only. The reasoning of the rubric question is addressed or not. + * + * Generated from protobuf field string reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getReasoning() + { + return $this->reasoning; + } + + /** + * Output only. The reasoning of the rubric question is addressed or not. + * + * Generated from protobuf field string reasoning = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setReasoning($var) + { + GPBUtil::checkString($var, True); + $this->reasoning = $var; + + return $this; + } + + /** + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * + * Generated from protobuf field optional bool is_addressed = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsAddressed() + { + return isset($this->is_addressed) ? $this->is_addressed : false; + } + + public function hasIsAddressed() + { + return isset($this->is_addressed); + } + + public function clearIsAddressed() + { + unset($this->is_addressed); + } + + /** + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * + * Generated from protobuf field optional bool is_addressed = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsAddressed($var) + { + GPBUtil::checkBool($var); + $this->is_addressed = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/CompletenessRubric.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/CompletenessRubric.php new file mode 100644 index 000000000000..ed32221e4c0d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/CompletenessRubric.php @@ -0,0 +1,119 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric + */ +class CompletenessRubric extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The question generated from instruction that used to + * evaluate summary. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $question = ''; + /** + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * + * Generated from protobuf field optional bool is_addressed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_addressed = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * Output only. The question generated from instruction that used to + * evaluate summary. + * @type bool $is_addressed + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The question generated from instruction that used to + * evaluate summary. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Output only. The question generated from instruction that used to + * evaluate summary. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * + * Generated from protobuf field optional bool is_addressed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsAddressed() + { + return isset($this->is_addressed) ? $this->is_addressed : false; + } + + public function hasIsAddressed() + { + return isset($this->is_addressed); + } + + public function clearIsAddressed() + { + unset($this->is_addressed); + } + + /** + * Output only. A boolean that indicates whether the rubric question is + * addressed or not. + * + * Generated from protobuf field optional bool is_addressed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsAddressed($var) + { + GPBUtil::checkBool($var); + $this->is_addressed = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail.php new file mode 100644 index 000000000000..b255c716c1f7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail.php @@ -0,0 +1,186 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail + */ +class ConversationDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Conversation transcript that used for summarization + * evaluation as a reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $message_entries; + /** + * Output only. Summary sections that used for summarization evaluation as a + * reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $summary_sections; + /** + * Output only. List of metric details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail metric_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $metric_details; + /** + * Output only. Conversation level token count per section. This is an + * aggregated(sum) result of input token of summary acorss all metrics for a + * single conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken section_tokens = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $section_tokens; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\MessageEntry[] $message_entries + * Output only. Conversation transcript that used for summarization + * evaluation as a reference. + * @type \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection[] $summary_sections + * Output only. Summary sections that used for summarization evaluation as a + * reference. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail[] $metric_details + * Output only. List of metric details. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken[] $section_tokens + * Output only. Conversation level token count per section. This is an + * aggregated(sum) result of input token of summary acorss all metrics for a + * single conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Conversation transcript that used for summarization + * evaluation as a reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\MessageEntry> + */ + public function getMessageEntries() + { + return $this->message_entries; + } + + /** + * Output only. Conversation transcript that used for summarization + * evaluation as a reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\MessageEntry[] $var + * @return $this + */ + public function setMessageEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\MessageEntry::class); + $this->message_entries = $arr; + + return $this; + } + + /** + * Output only. Summary sections that used for summarization evaluation as a + * reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection> + */ + public function getSummarySections() + { + return $this->summary_sections; + } + + /** + * Output only. Summary sections that used for summarization evaluation as a + * reference. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection[] $var + * @return $this + */ + public function setSummarySections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection::class); + $this->summary_sections = $arr; + + return $this; + } + + /** + * Output only. List of metric details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail metric_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail> + */ + public function getMetricDetails() + { + return $this->metric_details; + } + + /** + * Output only. List of metric details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail metric_details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail[] $var + * @return $this + */ + public function setMetricDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail::class); + $this->metric_details = $arr; + + return $this; + } + + /** + * Output only. Conversation level token count per section. This is an + * aggregated(sum) result of input token of summary acorss all metrics for a + * single conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken section_tokens = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken> + */ + public function getSectionTokens() + { + return $this->section_tokens; + } + + /** + * Output only. Conversation level token count per section. This is an + * aggregated(sum) result of input token of summary acorss all metrics for a + * single conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken section_tokens = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken[] $var + * @return $this + */ + public function setSectionTokens($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\SectionToken::class); + $this->section_tokens = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail.php new file mode 100644 index 000000000000..abee146bf198 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail + */ +class MetricDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Metrics name. e.g. accuracy, adherence, completeness. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $metric = ''; + /** + * Output only. Aggregated(average) score on this metric across all + * sections. + * + * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $score = null; + /** + * Output only. List of section details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail section_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $section_details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric + * Output only. Metrics name. e.g. accuracy, adherence, completeness. + * @type float $score + * Output only. Aggregated(average) score on this metric across all + * sections. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail[] $section_details + * Output only. List of section details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Metrics name. e.g. accuracy, adherence, completeness. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getMetric() + { + return $this->metric; + } + + /** + * Output only. Metrics name. e.g. accuracy, adherence, completeness. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * Output only. Aggregated(average) score on this metric across all + * sections. + * + * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * Output only. Aggregated(average) score on this metric across all + * sections. + * + * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * Output only. List of section details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail section_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail> + */ + public function getSectionDetails() + { + return $this->section_details; + } + + /** + * Output only. List of section details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail section_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail[] $var + * @return $this + */ + public function setSectionDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail::class); + $this->section_details = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail/SectionDetail.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail/SectionDetail.php new file mode 100644 index 000000000000..40e841d24c1e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/ConversationDetail/MetricDetail/SectionDetail.php @@ -0,0 +1,187 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail + */ +class SectionDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the summary instruction. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $section = ''; + /** + * Output only. Aggregated(average) score on this section across all + * evaluation results. Either decompositions or rubrics. + * + * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $score = null; + /** + * Output only. Summary for this section + * + * Generated from protobuf field string section_summary = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $section_summary = ''; + /** + * Output only. List of evaluation result. The list only contains one + * kind of the evaluation result. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult evaluation_results = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $evaluation_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section + * Output only. The name of the summary instruction. + * @type float $score + * Output only. Aggregated(average) score on this section across all + * evaluation results. Either decompositions or rubrics. + * @type string $section_summary + * Output only. Summary for this section + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult[] $evaluation_results + * Output only. List of evaluation result. The list only contains one + * kind of the evaluation result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the summary instruction. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Output only. The name of the summary instruction. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Output only. Aggregated(average) score on this section across all + * evaluation results. Either decompositions or rubrics. + * + * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getScore() + { + return isset($this->score) ? $this->score : 0.0; + } + + public function hasScore() + { + return isset($this->score); + } + + public function clearScore() + { + unset($this->score); + } + + /** + * Output only. Aggregated(average) score on this section across all + * evaluation results. Either decompositions or rubrics. + * + * Generated from protobuf field optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * Output only. Summary for this section + * + * Generated from protobuf field string section_summary = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSectionSummary() + { + return $this->section_summary; + } + + /** + * Output only. Summary for this section + * + * Generated from protobuf field string section_summary = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSectionSummary($var) + { + GPBUtil::checkString($var, True); + $this->section_summary = $var; + + return $this; + } + + /** + * Output only. List of evaluation result. The list only contains one + * kind of the evaluation result. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult evaluation_results = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult> + */ + public function getEvaluationResults() + { + return $this->evaluation_results; + } + + /** + * Output only. List of evaluation result. The list only contains one + * kind of the evaluation result. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult evaluation_results = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult[] $var + * @return $this + */ + public function setEvaluationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult::class); + $this->evaluation_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/Decomposition.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/Decomposition.php new file mode 100644 index 000000000000..6c07fe41a6f4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/Decomposition.php @@ -0,0 +1,109 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.Decomposition + */ +class Decomposition extends \Google\Protobuf\Internal\Message +{ + protected $decomposition; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition $accuracy_decomposition + * only available for accuracy metric. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceDecomposition $adherence_decomposition + * only available for adherence metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * only available for accuracy metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition accuracy_decomposition = 1; + * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition|null + */ + public function getAccuracyDecomposition() + { + return $this->readOneof(1); + } + + public function hasAccuracyDecomposition() + { + return $this->hasOneof(1); + } + + /** + * only available for accuracy metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition accuracy_decomposition = 1; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition $var + * @return $this + */ + public function setAccuracyDecomposition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * only available for adherence metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecomposition adherence_decomposition = 2; + * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceDecomposition|null + */ + public function getAdherenceDecomposition() + { + return $this->readOneof(2); + } + + public function hasAdherenceDecomposition() + { + return $this->hasOneof(2); + } + + /** + * only available for adherence metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecomposition adherence_decomposition = 2; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceDecomposition $var + * @return $this + */ + public function setAdherenceDecomposition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceDecomposition::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getDecomposition() + { + return $this->whichOneof("decomposition"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/EvaluationResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/EvaluationResult.php new file mode 100644 index 000000000000..62692102c0db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/EvaluationResult.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult + */ +class EvaluationResult extends \Google\Protobuf\Internal\Message +{ + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition $accuracy_decomposition + * Only available for accuracy metric. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric $adherence_rubric + * Only available for adherence metric. + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric $completeness_rubric + * Only available for completeness metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Only available for accuracy metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition accuracy_decomposition = 1; + * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition|null + */ + public function getAccuracyDecomposition() + { + return $this->readOneof(1); + } + + public function hasAccuracyDecomposition() + { + return $this->hasOneof(1); + } + + /** + * Only available for accuracy metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition accuracy_decomposition = 1; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition $var + * @return $this + */ + public function setAccuracyDecomposition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Only available for adherence metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric adherence_rubric = 2; + * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric|null + */ + public function getAdherenceRubric() + { + return $this->readOneof(2); + } + + public function hasAdherenceRubric() + { + return $this->hasOneof(2); + } + + /** + * Only available for adherence metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric adherence_rubric = 2; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric $var + * @return $this + */ + public function setAdherenceRubric($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Only available for completeness metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric completeness_rubric = 3; + * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric|null + */ + public function getCompletenessRubric() + { + return $this->readOneof(3); + } + + public function hasCompletenessRubric() + { + return $this->hasOneof(3); + } + + /** + * Only available for completeness metric. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric completeness_rubric = 3; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric $var + * @return $this + */ + public function setCompletenessRubric($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/OverallScoresByMetric.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/OverallScoresByMetric.php new file mode 100644 index 000000000000..d37c8b9d650c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/OverallScoresByMetric.php @@ -0,0 +1,69 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetric + */ +class OverallScoresByMetric extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Metric name. e.g. accuracy, adherence, completeness. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $metric = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $metric + * Output only. Metric name. e.g. accuracy, adherence, completeness. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Metric name. e.g. accuracy, adherence, completeness. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getMetric() + { + return $this->metric; + } + + /** + * Output only. Metric name. e.g. accuracy, adherence, completeness. + * + * Generated from protobuf field string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SectionToken.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SectionToken.php new file mode 100644 index 000000000000..41546e216516 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SectionToken.php @@ -0,0 +1,111 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken + */ +class SectionToken extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the summary instruction. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $section = ''; + /** + * Output only. Token count. + * + * Generated from protobuf field optional int64 token_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $token_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section + * Output only. The name of the summary instruction. + * @type int|string $token_count + * Output only. Token count. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the summary instruction. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Output only. The name of the summary instruction. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Output only. Token count. + * + * Generated from protobuf field optional int64 token_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTokenCount() + { + return isset($this->token_count) ? $this->token_count : 0; + } + + public function hasTokenCount() + { + return isset($this->token_count); + } + + public function clearTokenCount() + { + unset($this->token_count); + } + + /** + * Output only. Token count. + * + * Generated from protobuf field optional int64 token_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTokenCount($var) + { + GPBUtil::checkInt64($var); + $this->token_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SummarizationEvaluationResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SummarizationEvaluationResult.php new file mode 100644 index 000000000000..cfd8c15753d6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationEvaluationMetrics/SummarizationEvaluationResult.php @@ -0,0 +1,287 @@ +google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResult + */ +class SummarizationEvaluationResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. conversation session id + * + * Generated from protobuf field string session_id = 1 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated + */ + protected $session_id = ''; + /** + * Output only. metric name, e.g. accuracy, completeness, adherence, etc. + * + * Generated from protobuf field string metric = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $metric = ''; + /** + * Output only. section/task name, e.g. action, situation, etc + * + * Generated from protobuf field string section = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $section = ''; + /** + * Output only. score calculated from decompositions + * + * Generated from protobuf field float score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $score = 0.0; + /** + * Output only. Summary of this section + * + * Generated from protobuf field string section_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $section_summary = ''; + /** + * Output only. List of decompostion details + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.Decomposition decompositions = 7 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated + */ + private $decompositions; + /** + * Output only. List of evaluation results. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult evaluation_results = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $evaluation_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session_id + * Output only. conversation session id + * @type string $metric + * Output only. metric name, e.g. accuracy, completeness, adherence, etc. + * @type string $section + * Output only. section/task name, e.g. action, situation, etc + * @type float $score + * Output only. score calculated from decompositions + * @type string $section_summary + * Output only. Summary of this section + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\Decomposition[] $decompositions + * Output only. List of decompostion details + * @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult[] $evaluation_results + * Output only. List of evaluation results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. conversation session id + * + * Generated from protobuf field string session_id = 1 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + * @deprecated + */ + public function getSessionId() + { + if ($this->session_id !== '') { + @trigger_error('session_id is deprecated.', E_USER_DEPRECATED); + } + return $this->session_id; + } + + /** + * Output only. conversation session id + * + * Generated from protobuf field string session_id = 1 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + * @deprecated + */ + public function setSessionId($var) + { + @trigger_error('session_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->session_id = $var; + + return $this; + } + + /** + * Output only. metric name, e.g. accuracy, completeness, adherence, etc. + * + * Generated from protobuf field string metric = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getMetric() + { + return $this->metric; + } + + /** + * Output only. metric name, e.g. accuracy, completeness, adherence, etc. + * + * Generated from protobuf field string metric = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * Output only. section/task name, e.g. action, situation, etc + * + * Generated from protobuf field string section = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Output only. section/task name, e.g. action, situation, etc + * + * Generated from protobuf field string section = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Output only. score calculated from decompositions + * + * Generated from protobuf field float score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. score calculated from decompositions + * + * Generated from protobuf field float score = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * Output only. Summary of this section + * + * Generated from protobuf field string section_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSectionSummary() + { + return $this->section_summary; + } + + /** + * Output only. Summary of this section + * + * Generated from protobuf field string section_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSectionSummary($var) + { + GPBUtil::checkString($var, True); + $this->section_summary = $var; + + return $this; + } + + /** + * Output only. List of decompostion details + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.Decomposition decompositions = 7 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\Decomposition> + * @deprecated + */ + public function getDecompositions() + { + if ($this->decompositions->count() !== 0) { + @trigger_error('decompositions is deprecated.', E_USER_DEPRECATED); + } + return $this->decompositions; + } + + /** + * Output only. List of decompostion details + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.Decomposition decompositions = 7 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\Decomposition[] $var + * @return $this + * @deprecated + */ + public function setDecompositions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\Decomposition::class); + if ($arr->count() !== 0) { + @trigger_error('decompositions is deprecated.', E_USER_DEPRECATED); + } + $this->decompositions = $arr; + + return $this; + } + + /** + * Output only. List of evaluation results. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult evaluation_results = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult> + */ + public function getEvaluationResults() + { + return $this->evaluation_results; + } + + /** + * Output only. List of evaluation results. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult evaluation_results = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult[] $var + * @return $this + */ + public function setEvaluationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\EvaluationResult::class); + $this->evaluation_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php new file mode 100644 index 000000000000..93e0ec27dcb6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php @@ -0,0 +1,139 @@ +google.cloud.dialogflow.v2.SummarizationSection + */ +class SummarizationSection extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = ''; + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $definition = ''; + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Name of the section, for example, "situation". + * @type string $definition + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * @type int $type + * Optional. Type of the summarization section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefinition() + { + return $this->definition; + } + + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefinition($var) + { + GPBUtil::checkString($var, True); + $this->definition = $var; + + return $this; + } + + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SummarizationSection\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php new file mode 100644 index 000000000000..b61c054af94c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php @@ -0,0 +1,122 @@ +google.cloud.dialogflow.v2.SummarizationSection.Type + */ +class Type +{ + /** + * Undefined section type, does not return anything. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * What the customer needs help with or has question about. + * Section name: "situation". + * + * Generated from protobuf enum SITUATION = 1; + */ + const SITUATION = 1; + /** + * What the agent does to help the customer. + * Section name: "action". + * + * Generated from protobuf enum ACTION = 2; + */ + const ACTION = 2; + /** + * Result of the customer service. A single word describing the result + * of the conversation. + * Section name: "resolution". + * + * Generated from protobuf enum RESOLUTION = 3; + */ + const RESOLUTION = 3; + /** + * Reason for cancellation if the customer requests for a cancellation. + * "N/A" otherwise. + * Section name: "reason_for_cancellation". + * + * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; + */ + const REASON_FOR_CANCELLATION = 4; + /** + * "Unsatisfied" or "Satisfied" depending on the customer's feelings at + * the end of the conversation. + * Section name: "customer_satisfaction". + * + * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; + */ + const CUSTOMER_SATISFACTION = 5; + /** + * Key entities extracted from the conversation, such as ticket number, + * order number, dollar amount, etc. + * Section names are prefixed by "entities/". + * + * Generated from protobuf enum ENTITIES = 6; + */ + const ENTITIES = 6; + /** + * Customer defined sections. + * + * Generated from protobuf enum CUSTOMER_DEFINED = 7; + */ + const CUSTOMER_DEFINED = 7; + /** + * Concise version of the situation section. This type is only available if + * type SITUATION is not selected. + * + * Generated from protobuf enum SITUATION_CONCISE = 9; + */ + const SITUATION_CONCISE = 9; + /** + * Concise version of the action section. This type is only available if + * type ACTION is not selected. + * + * Generated from protobuf enum ACTION_CONCISE = 10; + */ + const ACTION_CONCISE = 10; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::SITUATION => 'SITUATION', + self::ACTION => 'ACTION', + self::RESOLUTION => 'RESOLUTION', + self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', + self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', + self::ENTITIES => 'ENTITIES', + self::CUSTOMER_DEFINED => 'CUSTOMER_DEFINED', + self::SITUATION_CONCISE => 'SITUATION_CONCISE', + self::ACTION_CONCISE => 'ACTION_CONCISE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php new file mode 100644 index 000000000000..363dad7ef899 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SummarizationSectionList + */ +class SummarizationSectionList extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $summarization_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarizationSection[] $summarization_sections + * Optional. Summarization sections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationSection> + */ + public function getSummarizationSections() + { + return $this->summarization_sections; + } + + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SummarizationSection[] $var + * @return $this + */ + public function setSummarizationSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); + $this->summarization_sections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php new file mode 100644 index 000000000000..52e65e88a472 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SummarySuggestion + */ +class SummarySuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $summary_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection[] $summary_sections + * Required. All the parts of generated summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection> + */ + public function getSummarySections() + { + return $this->summary_sections; + } + + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection[] $var + * @return $this + */ + public function setSummarySections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection::class); + $this->summary_sections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php new file mode 100644 index 000000000000..d2f6a34ed815 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.SummarySuggestion.SummarySection + */ +class SummarySection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $section = ''; + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $summary = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section + * Required. Name of the section. + * @type string $summary + * Required. Summary text for the section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkString($var, True); + $this->summary = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php new file mode 100644 index 000000000000..17ae741b86c5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php @@ -0,0 +1,303 @@ +google.cloud.dialogflow.v2.SynthesizeSpeechConfig + */ +class SynthesizeSpeechConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $pitch = 0.0; + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $volume_gain_db = 0.0; + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $effects_profile_id; + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $voice = null; + /** + * Optional. The custom pronunciations for the synthesized audio. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CustomPronunciationParams pronunciations = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $pronunciations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $speaking_rate + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * @type float $pitch + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * @type float $volume_gain_db + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * @type string[] $effects_profile_id + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * @type \Google\Cloud\Dialogflow\V2\VoiceSelectionParams $voice + * Optional. The desired voice of the synthesized audio. + * @type \Google\Cloud\Dialogflow\V2\CustomPronunciationParams[] $pronunciations + * Optional. The custom pronunciations for the synthesized audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getPitch() + { + return $this->pitch; + } + + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setPitch($var) + { + GPBUtil::checkDouble($var); + $this->pitch = $var; + + return $this; + } + + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getVolumeGainDb() + { + return $this->volume_gain_db; + } + + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setVolumeGainDb($var) + { + GPBUtil::checkDouble($var); + $this->volume_gain_db = $var; + + return $this; + } + + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getEffectsProfileId() + { + return $this->effects_profile_id; + } + + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setEffectsProfileId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->effects_profile_id = $arr; + + return $this; + } + + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + + /** + * Optional. The custom pronunciations for the synthesized audio. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CustomPronunciationParams pronunciations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\CustomPronunciationParams> + */ + public function getPronunciations() + { + return $this->pronunciations; + } + + /** + * Optional. The custom pronunciations for the synthesized audio. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.CustomPronunciationParams pronunciations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\CustomPronunciationParams[] $var + * @return $this + */ + public function setPronunciations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\CustomPronunciationParams::class); + $this->pronunciations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php new file mode 100644 index 000000000000..c647551cae30 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php @@ -0,0 +1,160 @@ +google.cloud.dialogflow.v2.TelephonyDtmf + */ +class TelephonyDtmf +{ + /** + * Not specified. This value may be used to indicate an absent digit. + * + * Generated from protobuf enum TELEPHONY_DTMF_UNSPECIFIED = 0; + */ + const TELEPHONY_DTMF_UNSPECIFIED = 0; + /** + * Number: '1'. + * + * Generated from protobuf enum DTMF_ONE = 1; + */ + const DTMF_ONE = 1; + /** + * Number: '2'. + * + * Generated from protobuf enum DTMF_TWO = 2; + */ + const DTMF_TWO = 2; + /** + * Number: '3'. + * + * Generated from protobuf enum DTMF_THREE = 3; + */ + const DTMF_THREE = 3; + /** + * Number: '4'. + * + * Generated from protobuf enum DTMF_FOUR = 4; + */ + const DTMF_FOUR = 4; + /** + * Number: '5'. + * + * Generated from protobuf enum DTMF_FIVE = 5; + */ + const DTMF_FIVE = 5; + /** + * Number: '6'. + * + * Generated from protobuf enum DTMF_SIX = 6; + */ + const DTMF_SIX = 6; + /** + * Number: '7'. + * + * Generated from protobuf enum DTMF_SEVEN = 7; + */ + const DTMF_SEVEN = 7; + /** + * Number: '8'. + * + * Generated from protobuf enum DTMF_EIGHT = 8; + */ + const DTMF_EIGHT = 8; + /** + * Number: '9'. + * + * Generated from protobuf enum DTMF_NINE = 9; + */ + const DTMF_NINE = 9; + /** + * Number: '0'. + * + * Generated from protobuf enum DTMF_ZERO = 10; + */ + const DTMF_ZERO = 10; + /** + * Letter: 'A'. + * + * Generated from protobuf enum DTMF_A = 11; + */ + const DTMF_A = 11; + /** + * Letter: 'B'. + * + * Generated from protobuf enum DTMF_B = 12; + */ + const DTMF_B = 12; + /** + * Letter: 'C'. + * + * Generated from protobuf enum DTMF_C = 13; + */ + const DTMF_C = 13; + /** + * Letter: 'D'. + * + * Generated from protobuf enum DTMF_D = 14; + */ + const DTMF_D = 14; + /** + * Asterisk/star: '*'. + * + * Generated from protobuf enum DTMF_STAR = 15; + */ + const DTMF_STAR = 15; + /** + * Pound/diamond/hash/square/gate/octothorpe: '#'. + * + * Generated from protobuf enum DTMF_POUND = 16; + */ + const DTMF_POUND = 16; + + private static $valueToName = [ + self::TELEPHONY_DTMF_UNSPECIFIED => 'TELEPHONY_DTMF_UNSPECIFIED', + self::DTMF_ONE => 'DTMF_ONE', + self::DTMF_TWO => 'DTMF_TWO', + self::DTMF_THREE => 'DTMF_THREE', + self::DTMF_FOUR => 'DTMF_FOUR', + self::DTMF_FIVE => 'DTMF_FIVE', + self::DTMF_SIX => 'DTMF_SIX', + self::DTMF_SEVEN => 'DTMF_SEVEN', + self::DTMF_EIGHT => 'DTMF_EIGHT', + self::DTMF_NINE => 'DTMF_NINE', + self::DTMF_ZERO => 'DTMF_ZERO', + self::DTMF_A => 'DTMF_A', + self::DTMF_B => 'DTMF_B', + self::DTMF_C => 'DTMF_C', + self::DTMF_D => 'DTMF_D', + self::DTMF_STAR => 'DTMF_STAR', + self::DTMF_POUND => 'DTMF_POUND', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php new file mode 100644 index 000000000000..d5e6c6fbc628 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.TelephonyDtmfEvents + */ +class TelephonyDtmfEvents extends \Google\Protobuf\Internal\Message +{ + /** + * A sequence of TelephonyDtmf digits. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + */ + private $dtmf_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[] $dtmf_events + * A sequence of TelephonyDtmf digits. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * A sequence of TelephonyDtmf digits. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * @return RepeatedField + */ + public function getDtmfEvents() + { + return $this->dtmf_events; + } + + /** + * A sequence of TelephonyDtmf digits. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * @param int[] $var + * @return $this + */ + public function setDtmfEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TelephonyDtmf::class); + $this->dtmf_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php new file mode 100644 index 000000000000..266240be43f3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php @@ -0,0 +1,118 @@ +google.cloud.dialogflow.v2.TextInput + */ +class TextInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * @type string $language_code + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php new file mode 100644 index 000000000000..328c1a4f9c7b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php @@ -0,0 +1,197 @@ +google.cloud.dialogflow.v2.TextToSpeechSettings + */ +class TextToSpeechSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * + * Generated from protobuf field bool enable_text_to_speech = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_text_to_speech = false; + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding output_audio_encoding = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_audio_encoding = 0; + /** + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_rate_hertz = 0; + /** + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * + * Generated from protobuf field map synthesize_speech_configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $synthesize_speech_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_text_to_speech + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * @type int $output_audio_encoding + * Required. Audio encoding of the synthesized audio content. + * @type int $sample_rate_hertz + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * @type array|\Google\Protobuf\Internal\MapField $synthesize_speech_configs + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * + * Generated from protobuf field bool enable_text_to_speech = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableTextToSpeech() + { + return $this->enable_text_to_speech; + } + + /** + * Optional. Indicates whether text to speech is enabled. Even when this field + * is false, other settings in this proto are still retained. + * + * Generated from protobuf field bool enable_text_to_speech = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableTextToSpeech($var) + { + GPBUtil::checkBool($var); + $this->enable_text_to_speech = $var; + + return $this; + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding output_audio_encoding = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOutputAudioEncoding() + { + return $this->output_audio_encoding; + } + + /** + * Required. Audio encoding of the synthesized audio content. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioEncoding output_audio_encoding = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOutputAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\OutputAudioEncoding::class); + $this->output_audio_encoding = $var; + + return $this; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Optional. The synthesis sample rate (in hertz) for this audio. If not + * provided, then the synthesizer will use the default sample rate based on + * the audio encoding. If this is different from the voice's natural sample + * rate, then the synthesizer will honor this request by converting to the + * desired sample rate (which might result in worse audio quality). + * + * Generated from protobuf field int32 sample_rate_hertz = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * + * Generated from protobuf field map synthesize_speech_configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSynthesizeSpeechConfigs() + { + return $this->synthesize_speech_configs; + } + + /** + * Optional. Configuration of how speech should be synthesized, mapping from + * language (https://cloud.google.com/dialogflow/docs/reference/language) to + * SynthesizeSpeechConfig. + * + * Generated from protobuf field map synthesize_speech_configs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSynthesizeSpeechConfigs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SynthesizeSpeechConfig::class); + $this->synthesize_speech_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool.php new file mode 100644 index 000000000000..b53c64ef98a0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool.php @@ -0,0 +1,569 @@ +google.cloud.dialogflow.v2.Tool + */ +class Tool extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the tool. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. A human readable short name of the tool, which should be unique + * within the project. It should only contain letters, numbers, and + * underscores, and it will be used by LLM to identify the tool. + * + * Generated from protobuf field string tool_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tool_key = ''; + /** + * Optional. A human readable short name of the tool, to be shown on the UI. + * + * Generated from protobuf field string display_name = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. A human readable description of the tool. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Confirmation requirement for the actions. Each key is an action + * name in the action_schemas. If an action's confirmation requirement is + * unspecified (either the key is not present, or its value is + * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the + * action's method_type - confirmation is not required if and only if + * method_type is GET. + * + * Generated from protobuf field map action_confirmation_requirement = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $action_confirmation_requirement; + /** + * Output only. Creation time of this tool. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of this tool. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the tool. If the field is absent, it means the status is unknown. + * + * Generated from protobuf field optional bool satisfies_pzs = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the tool. If the field is absent, it means the status is unknown. + * + * Generated from protobuf field optional bool satisfies_pzi = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + protected $specification; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the tool. Format: + * `projects//locations//tools/`. + * @type string $tool_key + * Required. A human readable short name of the tool, which should be unique + * within the project. It should only contain letters, numbers, and + * underscores, and it will be used by LLM to identify the tool. + * @type string $display_name + * Optional. A human readable short name of the tool, to be shown on the UI. + * @type string $description + * Optional. A human readable description of the tool. + * @type array|\Google\Protobuf\Internal\MapField $action_confirmation_requirement + * Optional. Confirmation requirement for the actions. Each key is an action + * name in the action_schemas. If an action's confirmation requirement is + * unspecified (either the key is not present, or its value is + * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the + * action's method_type - confirmation is not required if and only if + * method_type is GET. + * @type \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool $extension_spec + * Vertex extension tool specification. + * @type \Google\Cloud\Dialogflow\V2\Tool\FunctionTool $function_spec + * Client side executed function specification. + * @type \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool $connector_spec + * Integration connectors tool specification. + * @type \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool $open_api_spec + * OpenAPI tool. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this tool. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of this tool. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation + * status of the tool. If the field is absent, it means the status is unknown. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status + * of the tool. If the field is absent, it means the status is unknown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the tool. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the tool. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. A human readable short name of the tool, which should be unique + * within the project. It should only contain letters, numbers, and + * underscores, and it will be used by LLM to identify the tool. + * + * Generated from protobuf field string tool_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getToolKey() + { + return $this->tool_key; + } + + /** + * Required. A human readable short name of the tool, which should be unique + * within the project. It should only contain letters, numbers, and + * underscores, and it will be used by LLM to identify the tool. + * + * Generated from protobuf field string tool_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setToolKey($var) + { + GPBUtil::checkString($var, True); + $this->tool_key = $var; + + return $this; + } + + /** + * Optional. A human readable short name of the tool, to be shown on the UI. + * + * Generated from protobuf field string display_name = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A human readable short name of the tool, to be shown on the UI. + * + * Generated from protobuf field string display_name = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. A human readable description of the tool. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A human readable description of the tool. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Confirmation requirement for the actions. Each key is an action + * name in the action_schemas. If an action's confirmation requirement is + * unspecified (either the key is not present, or its value is + * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the + * action's method_type - confirmation is not required if and only if + * method_type is GET. + * + * Generated from protobuf field map action_confirmation_requirement = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getActionConfirmationRequirement() + { + return $this->action_confirmation_requirement; + } + + /** + * Optional. Confirmation requirement for the actions. Each key is an action + * name in the action_schemas. If an action's confirmation requirement is + * unspecified (either the key is not present, or its value is + * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the + * action's method_type - confirmation is not required if and only if + * method_type is GET. + * + * Generated from protobuf field map action_confirmation_requirement = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setActionConfirmationRequirement($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Tool\ConfirmationRequirement::class); + $this->action_confirmation_requirement = $arr; + + return $this; + } + + /** + * Vertex extension tool specification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ExtensionTool extension_spec = 4 [deprecated = true]; + * @return \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool|null + * @deprecated + */ + public function getExtensionSpec() + { + if ($this->hasOneof(4)) { + @trigger_error('extension_spec is deprecated.', E_USER_DEPRECATED); + } + return $this->readOneof(4); + } + + public function hasExtensionSpec() + { + if ($this->hasOneof(4)) { + @trigger_error('extension_spec is deprecated.', E_USER_DEPRECATED); + } + return $this->hasOneof(4); + } + + /** + * Vertex extension tool specification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ExtensionTool extension_spec = 4 [deprecated = true]; + * @param \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool $var + * @return $this + * @deprecated + */ + public function setExtensionSpec($var) + { + @trigger_error('extension_spec is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Client side executed function specification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.FunctionTool function_spec = 13; + * @return \Google\Cloud\Dialogflow\V2\Tool\FunctionTool|null + */ + public function getFunctionSpec() + { + return $this->readOneof(13); + } + + public function hasFunctionSpec() + { + return $this->hasOneof(13); + } + + /** + * Client side executed function specification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.FunctionTool function_spec = 13; + * @param \Google\Cloud\Dialogflow\V2\Tool\FunctionTool $var + * @return $this + */ + public function setFunctionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\FunctionTool::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Integration connectors tool specification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool connector_spec = 18; + * @return \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool|null + */ + public function getConnectorSpec() + { + return $this->readOneof(18); + } + + public function hasConnectorSpec() + { + return $this->hasOneof(18); + } + + /** + * Integration connectors tool specification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool connector_spec = 18; + * @param \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool $var + * @return $this + */ + public function setConnectorSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool::class); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * OpenAPI tool. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.OpenApiTool open_api_spec = 20; + * @return \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool|null + */ + public function getOpenApiSpec() + { + return $this->readOneof(20); + } + + public function hasOpenApiSpec() + { + return $this->hasOneof(20); + } + + /** + * OpenAPI tool. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.OpenApiTool open_api_spec = 20; + * @param \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool $var + * @return $this + */ + public function setOpenApiSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool::class); + $this->writeOneof(20, $var); + + return $this; + } + + /** + * Output only. Creation time of this tool. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this tool. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of this tool. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of this tool. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the tool. If the field is absent, it means the status is unknown. + * + * Generated from protobuf field optional bool satisfies_pzs = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the tool. If the field is absent, it means the status is unknown. + * + * Generated from protobuf field optional bool satisfies_pzs = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the tool. If the field is absent, it means the status is unknown. + * + * Generated from protobuf field optional bool satisfies_pzi = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the tool. If the field is absent, it means the status is unknown. + * + * Generated from protobuf field optional bool satisfies_pzi = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * @return string + */ + public function getSpecification() + { + return $this->whichOneof("specification"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication.php new file mode 100644 index 000000000000..25b25f0d4bae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication.php @@ -0,0 +1,180 @@ +google.cloud.dialogflow.v2.Tool.Authentication + */ +class Authentication extends \Google\Protobuf\Internal\Message +{ + protected $auth_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Tool\Authentication\ApiKeyConfig $api_key_config + * Config for API key auth. + * @type \Google\Cloud\Dialogflow\V2\Tool\Authentication\OAuthConfig $oauth_config + * Config for OAuth. + * @type \Google\Cloud\Dialogflow\V2\Tool\Authentication\ServiceAgentAuthConfig $service_agent_auth_config + * Config for [Diglogflow service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) + * auth. + * @type \Google\Cloud\Dialogflow\V2\Tool\Authentication\BearerTokenConfig $bearer_token_config + * Config for bearer token auth. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Config for API key auth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfig api_key_config = 1; + * @return \Google\Cloud\Dialogflow\V2\Tool\Authentication\ApiKeyConfig|null + */ + public function getApiKeyConfig() + { + return $this->readOneof(1); + } + + public function hasApiKeyConfig() + { + return $this->hasOneof(1); + } + + /** + * Config for API key auth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfig api_key_config = 1; + * @param \Google\Cloud\Dialogflow\V2\Tool\Authentication\ApiKeyConfig $var + * @return $this + */ + public function setApiKeyConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\ApiKeyConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Config for OAuth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig oauth_config = 2; + * @return \Google\Cloud\Dialogflow\V2\Tool\Authentication\OAuthConfig|null + */ + public function getOauthConfig() + { + return $this->readOneof(2); + } + + public function hasOauthConfig() + { + return $this->hasOneof(2); + } + + /** + * Config for OAuth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig oauth_config = 2; + * @param \Google\Cloud\Dialogflow\V2\Tool\Authentication\OAuthConfig $var + * @return $this + */ + public function setOauthConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\OAuthConfig::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Config for [Diglogflow service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) + * auth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig service_agent_auth_config = 3; + * @return \Google\Cloud\Dialogflow\V2\Tool\Authentication\ServiceAgentAuthConfig|null + */ + public function getServiceAgentAuthConfig() + { + return $this->readOneof(3); + } + + public function hasServiceAgentAuthConfig() + { + return $this->hasOneof(3); + } + + /** + * Config for [Diglogflow service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) + * auth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig service_agent_auth_config = 3; + * @param \Google\Cloud\Dialogflow\V2\Tool\Authentication\ServiceAgentAuthConfig $var + * @return $this + */ + public function setServiceAgentAuthConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\ServiceAgentAuthConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Config for bearer token auth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfig bearer_token_config = 4; + * @return \Google\Cloud\Dialogflow\V2\Tool\Authentication\BearerTokenConfig|null + */ + public function getBearerTokenConfig() + { + return $this->readOneof(4); + } + + public function hasBearerTokenConfig() + { + return $this->hasOneof(4); + } + + /** + * Config for bearer token auth. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfig bearer_token_config = 4; + * @param \Google\Cloud\Dialogflow\V2\Tool\Authentication\BearerTokenConfig $var + * @return $this + */ + public function setBearerTokenConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\BearerTokenConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthConfig() + { + return $this->whichOneof("auth_config"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ApiKeyConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ApiKeyConfig.php new file mode 100644 index 000000000000..40fd747af0e6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ApiKeyConfig.php @@ -0,0 +1,189 @@ +google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfig + */ +class ApiKeyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parameter name or the header name of the API key. + * E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + * + * Generated from protobuf field string key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key_name = ''; + /** + * Optional. The API key. If the `secret_version_for_api_key` field is + * set, this field will be ignored. + * + * Generated from protobuf field string api_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $api_key = ''; + /** + * Optional. The name of the SecretManager secret version resource storing + * the API key. If this field is set, the `api_key` field will be ignored. + * Format: `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_api_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $secret_version_for_api_key = ''; + /** + * Required. Key location in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $request_location = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_name + * Required. The parameter name or the header name of the API key. + * E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + * @type string $api_key + * Optional. The API key. If the `secret_version_for_api_key` field is + * set, this field will be ignored. + * @type string $secret_version_for_api_key + * Optional. The name of the SecretManager secret version resource storing + * the API key. If this field is set, the `api_key` field will be ignored. + * Format: `projects/{project}/secrets/{secret}/versions/{version}` + * @type int $request_location + * Required. Key location in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parameter name or the header name of the API key. + * E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + * + * Generated from protobuf field string key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKeyName() + { + return $this->key_name; + } + + /** + * Required. The parameter name or the header name of the API key. + * E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + * + * Generated from protobuf field string key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKeyName($var) + { + GPBUtil::checkString($var, True); + $this->key_name = $var; + + return $this; + } + + /** + * Optional. The API key. If the `secret_version_for_api_key` field is + * set, this field will be ignored. + * + * Generated from protobuf field string api_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getApiKey() + { + return $this->api_key; + } + + /** + * Optional. The API key. If the `secret_version_for_api_key` field is + * set, this field will be ignored. + * + * Generated from protobuf field string api_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setApiKey($var) + { + GPBUtil::checkString($var, True); + $this->api_key = $var; + + return $this; + } + + /** + * Optional. The name of the SecretManager secret version resource storing + * the API key. If this field is set, the `api_key` field will be ignored. + * Format: `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_api_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getSecretVersionForApiKey() + { + return $this->secret_version_for_api_key; + } + + /** + * Optional. The name of the SecretManager secret version resource storing + * the API key. If this field is set, the `api_key` field will be ignored. + * Format: `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_api_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecretVersionForApiKey($var) + { + GPBUtil::checkString($var, True); + $this->secret_version_for_api_key = $var; + + return $this; + } + + /** + * Required. Key location in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRequestLocation() + { + return $this->request_location; + } + + /** + * Required. Key location in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRequestLocation($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\RequestLocation::class); + $this->request_location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/BearerTokenConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/BearerTokenConfig.php new file mode 100644 index 000000000000..d03361c0a8a8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/BearerTokenConfig.php @@ -0,0 +1,133 @@ +google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfig + */ +class BearerTokenConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The text token appended to the text `Bearer` to the request + * Authorization header. + * [Session parameters + * reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + * can be used to pass the token dynamically, e.g. + * `$session.params.parameter-id`. + * + * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $token = ''; + /** + * Optional. The name of the SecretManager secret version resource storing + * the Bearer token. If this field is set, the `token` field will be + * ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_token = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $secret_version_for_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * Optional. The text token appended to the text `Bearer` to the request + * Authorization header. + * [Session parameters + * reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + * can be used to pass the token dynamically, e.g. + * `$session.params.parameter-id`. + * @type string $secret_version_for_token + * Optional. The name of the SecretManager secret version resource storing + * the Bearer token. If this field is set, the `token` field will be + * ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The text token appended to the text `Bearer` to the request + * Authorization header. + * [Session parameters + * reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + * can be used to pass the token dynamically, e.g. + * `$session.params.parameter-id`. + * + * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * Optional. The text token appended to the text `Bearer` to the request + * Authorization header. + * [Session parameters + * reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + * can be used to pass the token dynamically, e.g. + * `$session.params.parameter-id`. + * + * Generated from protobuf field string token = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * Optional. The name of the SecretManager secret version resource storing + * the Bearer token. If this field is set, the `token` field will be + * ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_token = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getSecretVersionForToken() + { + return $this->secret_version_for_token; + } + + /** + * Optional. The name of the SecretManager secret version resource storing + * the Bearer token. If this field is set, the `token` field will be + * ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_token = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecretVersionForToken($var) + { + GPBUtil::checkString($var, True); + $this->secret_version_for_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig.php new file mode 100644 index 000000000000..649fb2d61041 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig.php @@ -0,0 +1,261 @@ +google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig + */ +class OAuthConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. OAuth grant types. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $oauth_grant_type = 0; + /** + * Required. The client ID from the OAuth provider. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $client_id = ''; + /** + * Optional. The client secret from the OAuth provider. If the + * `secret_version_for_client_secret` field is set, this field will be + * ignored. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_secret = ''; + /** + * Optional. The name of the SecretManager secret version resource storing + * the client secret. If this field is set, the `client_secret` field will + * be ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_client_secret = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $secret_version_for_client_secret = ''; + /** + * Required. The token endpoint in the OAuth provider to exchange for an + * access token. + * + * Generated from protobuf field string token_endpoint = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $token_endpoint = ''; + /** + * Optional. The OAuth scopes to grant. + * + * Generated from protobuf field repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $oauth_grant_type + * Required. OAuth grant types. + * @type string $client_id + * Required. The client ID from the OAuth provider. + * @type string $client_secret + * Optional. The client secret from the OAuth provider. If the + * `secret_version_for_client_secret` field is set, this field will be + * ignored. + * @type string $secret_version_for_client_secret + * Optional. The name of the SecretManager secret version resource storing + * the client secret. If this field is set, the `client_secret` field will + * be ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * @type string $token_endpoint + * Required. The token endpoint in the OAuth provider to exchange for an + * access token. + * @type string[] $scopes + * Optional. The OAuth scopes to grant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. OAuth grant types. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOauthGrantType() + { + return $this->oauth_grant_type; + } + + /** + * Required. OAuth grant types. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOauthGrantType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\OAuthConfig\OauthGrantType::class); + $this->oauth_grant_type = $var; + + return $this; + } + + /** + * Required. The client ID from the OAuth provider. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Required. The client ID from the OAuth provider. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Optional. The client secret from the OAuth provider. If the + * `secret_version_for_client_secret` field is set, this field will be + * ignored. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getClientSecret() + { + return $this->client_secret; + } + + /** + * Optional. The client secret from the OAuth provider. If the + * `secret_version_for_client_secret` field is set, this field will be + * ignored. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setClientSecret($var) + { + GPBUtil::checkString($var, True); + $this->client_secret = $var; + + return $this; + } + + /** + * Optional. The name of the SecretManager secret version resource storing + * the client secret. If this field is set, the `client_secret` field will + * be ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_client_secret = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getSecretVersionForClientSecret() + { + return $this->secret_version_for_client_secret; + } + + /** + * Optional. The name of the SecretManager secret version resource storing + * the client secret. If this field is set, the `client_secret` field will + * be ignored. Format: + * `projects/{project}/secrets/{secret}/versions/{version}` + * + * Generated from protobuf field string secret_version_for_client_secret = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecretVersionForClientSecret($var) + { + GPBUtil::checkString($var, True); + $this->secret_version_for_client_secret = $var; + + return $this; + } + + /** + * Required. The token endpoint in the OAuth provider to exchange for an + * access token. + * + * Generated from protobuf field string token_endpoint = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTokenEndpoint() + { + return $this->token_endpoint; + } + + /** + * Required. The token endpoint in the OAuth provider to exchange for an + * access token. + * + * Generated from protobuf field string token_endpoint = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTokenEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->token_endpoint = $var; + + return $this; + } + + /** + * Optional. The OAuth scopes to grant. + * + * Generated from protobuf field repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Optional. The OAuth scopes to grant. + * + * Generated from protobuf field repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig/OauthGrantType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig/OauthGrantType.php new file mode 100644 index 000000000000..4a2c75e34011 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/OAuthConfig/OauthGrantType.php @@ -0,0 +1,57 @@ +google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantType + */ +class OauthGrantType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum OAUTH_GRANT_TYPE_UNSPECIFIED = 0; + */ + const OAUTH_GRANT_TYPE_UNSPECIFIED = 0; + /** + * Represents the [client credential + * flow](https://oauth.net/2/grant-types/client-credentials). + * + * Generated from protobuf enum CLIENT_CREDENTIAL = 1; + */ + const CLIENT_CREDENTIAL = 1; + + private static $valueToName = [ + self::OAUTH_GRANT_TYPE_UNSPECIFIED => 'OAUTH_GRANT_TYPE_UNSPECIFIED', + self::CLIENT_CREDENTIAL => 'CLIENT_CREDENTIAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/RequestLocation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/RequestLocation.php new file mode 100644 index 000000000000..af40f7235739 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/RequestLocation.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation + */ +class RequestLocation +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum REQUEST_LOCATION_UNSPECIFIED = 0; + */ + const REQUEST_LOCATION_UNSPECIFIED = 0; + /** + * Represents the key in http header. + * + * Generated from protobuf enum HEADER = 1; + */ + const HEADER = 1; + /** + * Represents the key in query string. + * + * Generated from protobuf enum QUERY_STRING = 2; + */ + const QUERY_STRING = 2; + + private static $valueToName = [ + self::REQUEST_LOCATION_UNSPECIFIED => 'REQUEST_LOCATION_UNSPECIFIED', + self::HEADER => 'HEADER', + self::QUERY_STRING => 'QUERY_STRING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig.php new file mode 100644 index 000000000000..2d9046aaa255 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig.php @@ -0,0 +1,80 @@ +google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig + */ +class ServiceAgentAuthConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Indicate the auth token type generated from the [Diglogflow + * service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + * The generated token is sent in the Authorization header. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth service_agent_auth = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_agent_auth = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $service_agent_auth + * Optional. Indicate the auth token type generated from the [Diglogflow + * service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + * The generated token is sent in the Authorization header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Indicate the auth token type generated from the [Diglogflow + * service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + * The generated token is sent in the Authorization header. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth service_agent_auth = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getServiceAgentAuth() + { + return $this->service_agent_auth; + } + + /** + * Optional. Indicate the auth token type generated from the [Diglogflow + * service + * agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + * The generated token is sent in the Authorization header. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth service_agent_auth = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setServiceAgentAuth($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\ServiceAgentAuthConfig\ServiceAgentAuth::class); + $this->service_agent_auth = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig/ServiceAgentAuth.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig/ServiceAgentAuth.php new file mode 100644 index 000000000000..57d77e105ec1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/Authentication/ServiceAgentAuthConfig/ServiceAgentAuth.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth + */ +class ServiceAgentAuth +{ + /** + * Service agent auth type unspecified. Default to ID_TOKEN. + * + * Generated from protobuf enum SERVICE_AGENT_AUTH_UNSPECIFIED = 0; + */ + const SERVICE_AGENT_AUTH_UNSPECIFIED = 0; + /** + * Use [ID + * token](https://cloud.google.com/docs/authentication/token-types#id) + * generated from service agent. This can be used to access Cloud + * Function and Cloud Run after you grant Invoker role to + * `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com`. + * + * Generated from protobuf enum ID_TOKEN = 1; + */ + const ID_TOKEN = 1; + /** + * Use [access + * token](https://cloud.google.com/docs/authentication/token-types#access) + * generated from service agent. This can be used to access other Google + * Cloud APIs after you grant required roles to + * `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com`. + * + * Generated from protobuf enum ACCESS_TOKEN = 2; + */ + const ACCESS_TOKEN = 2; + + private static $valueToName = [ + self::SERVICE_AGENT_AUTH_UNSPECIFIED => 'SERVICE_AGENT_AUTH_UNSPECIFIED', + self::ID_TOKEN => 'ID_TOKEN', + self::ACCESS_TOKEN => 'ACCESS_TOKEN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConfirmationRequirement.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConfirmationRequirement.php new file mode 100644 index 000000000000..f8888dd4ae2e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConfirmationRequirement.php @@ -0,0 +1,62 @@ +google.cloud.dialogflow.v2.Tool.ConfirmationRequirement + */ +class ConfirmationRequirement +{ + /** + * Unspecified. Whether the action requires confirmation is inferred from + * method_type. + * + * Generated from protobuf enum CONFIRMATION_REQUIREMENT_UNSPECIFIED = 0; + */ + const CONFIRMATION_REQUIREMENT_UNSPECIFIED = 0; + /** + * Conformation is required. + * + * Generated from protobuf enum REQUIRED = 1; + */ + const REQUIRED = 1; + /** + * Conformation is not required. + * + * Generated from protobuf enum NOT_REQUIRED = 2; + */ + const NOT_REQUIRED = 2; + + private static $valueToName = [ + self::CONFIRMATION_REQUIREMENT_UNSPECIFIED => 'CONFIRMATION_REQUIREMENT_UNSPECIFIED', + self::REQUIRED => 'REQUIRED', + self::NOT_REQUIRED => 'NOT_REQUIRED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool.php new file mode 100644 index 000000000000..3407c3869782 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.Tool.ConnectorTool + */ +class ConnectorTool extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full resource name of the referenced Integration Connectors + * Connection. Format: 'projects/{@*}locations/{@*}connections/*' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Actions for the tool to use. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action actions = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $actions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full resource name of the referenced Integration Connectors + * Connection. Format: 'projects/{@*}locations/{@*}connections/*' + * @type \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action[] $actions + * Required. Actions for the tool to use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full resource name of the referenced Integration Connectors + * Connection. Format: 'projects/{@*}locations/{@*}connections/*' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full resource name of the referenced Integration Connectors + * Connection. Format: 'projects/{@*}locations/{@*}connections/*' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Actions for the tool to use. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action actions = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action> + */ + public function getActions() + { + return $this->actions; + } + + /** + * Required. Actions for the tool to use. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action actions = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action[] $var + * @return $this + */ + public function setActions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action::class); + $this->actions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action.php new file mode 100644 index 000000000000..ed68239e9dbe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action.php @@ -0,0 +1,184 @@ +google.cloud.dialogflow.v2.Tool.ConnectorTool.Action + */ +class Action extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Entity fields to use as inputs for the operation. + * If no fields are specified, all fields of the Entity will be used. + * + * Generated from protobuf field repeated string input_fields = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $input_fields; + /** + * Optional. Entity fields to return from the operation. + * If no fields are specified, all fields of the Entity will be returned. + * + * Generated from protobuf field repeated string output_fields = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $output_fields; + protected $action_spec; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection_action_id + * ID of a Connection action for the tool to use. + * @type \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action\EntityOperation $entity_operation + * Entity operation configuration for the tool to use. + * @type string[] $input_fields + * Optional. Entity fields to use as inputs for the operation. + * If no fields are specified, all fields of the Entity will be used. + * @type string[] $output_fields + * Optional. Entity fields to return from the operation. + * If no fields are specified, all fields of the Entity will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * ID of a Connection action for the tool to use. + * + * Generated from protobuf field string connection_action_id = 4; + * @return string + */ + public function getConnectionActionId() + { + return $this->readOneof(4); + } + + public function hasConnectionActionId() + { + return $this->hasOneof(4); + } + + /** + * ID of a Connection action for the tool to use. + * + * Generated from protobuf field string connection_action_id = 4; + * @param string $var + * @return $this + */ + public function setConnectionActionId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Entity operation configuration for the tool to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation entity_operation = 5; + * @return \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action\EntityOperation|null + */ + public function getEntityOperation() + { + return $this->readOneof(5); + } + + public function hasEntityOperation() + { + return $this->hasOneof(5); + } + + /** + * Entity operation configuration for the tool to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation entity_operation = 5; + * @param \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action\EntityOperation $var + * @return $this + */ + public function setEntityOperation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action\EntityOperation::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. Entity fields to use as inputs for the operation. + * If no fields are specified, all fields of the Entity will be used. + * + * Generated from protobuf field repeated string input_fields = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getInputFields() + { + return $this->input_fields; + } + + /** + * Optional. Entity fields to use as inputs for the operation. + * If no fields are specified, all fields of the Entity will be used. + * + * Generated from protobuf field repeated string input_fields = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setInputFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->input_fields = $arr; + + return $this; + } + + /** + * Optional. Entity fields to return from the operation. + * If no fields are specified, all fields of the Entity will be returned. + * + * Generated from protobuf field repeated string output_fields = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getOutputFields() + { + return $this->output_fields; + } + + /** + * Optional. Entity fields to return from the operation. + * If no fields are specified, all fields of the Entity will be returned. + * + * Generated from protobuf field repeated string output_fields = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setOutputFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->output_fields = $arr; + + return $this; + } + + /** + * @return string + */ + public function getActionSpec() + { + return $this->whichOneof("action_spec"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation.php new file mode 100644 index 000000000000..9e8379f92670 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation.php @@ -0,0 +1,101 @@ +google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation + */ +class EntityOperation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the entity. + * + * Generated from protobuf field string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_id = ''; + /** + * Required. Operation to perform on the entity. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType operation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $entity_id + * Required. ID of the entity. + * @type int $operation + * Required. Operation to perform on the entity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the entity. + * + * Generated from protobuf field string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEntityId() + { + return $this->entity_id; + } + + /** + * Required. ID of the entity. + * + * Generated from protobuf field string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEntityId($var) + { + GPBUtil::checkString($var, True); + $this->entity_id = $var; + + return $this; + } + + /** + * Required. Operation to perform on the entity. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType operation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Required. Operation to perform on the entity. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType operation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action\EntityOperation\OperationType::class); + $this->operation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation/OperationType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation/OperationType.php new file mode 100644 index 000000000000..03610abcf33a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ConnectorTool/Action/EntityOperation/OperationType.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType + */ +class OperationType +{ + /** + * Operation type unspecified. Invalid, ConnectorTool create/update + * will fail. + * + * Generated from protobuf enum OPERATION_TYPE_UNSPECIFIED = 0; + */ + const OPERATION_TYPE_UNSPECIFIED = 0; + /** + * List operation. + * + * Generated from protobuf enum LIST = 1; + */ + const PBLIST = 1; + /** + * Get operation. + * + * Generated from protobuf enum GET = 2; + */ + const GET = 2; + /** + * Create operation. + * + * Generated from protobuf enum CREATE = 3; + */ + const CREATE = 3; + /** + * Update operation. + * + * Generated from protobuf enum UPDATE = 4; + */ + const UPDATE = 4; + /** + * Delete operation. + * + * Generated from protobuf enum DELETE = 5; + */ + const DELETE = 5; + + private static $valueToName = [ + self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED', + self::PBLIST => 'LIST', + self::GET => 'GET', + self::CREATE => 'CREATE', + self::UPDATE => 'UPDATE', + self::DELETE => 'DELETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ExtensionTool.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ExtensionTool.php new file mode 100644 index 000000000000..ae6f8c6112ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ExtensionTool.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.Tool.ExtensionTool + */ +class ExtensionTool extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the referenced vertex extension. + * Format: + * `projects/{project}/locations/{location}/extensions/{extension}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the referenced vertex extension. + * Format: + * `projects/{project}/locations/{location}/extensions/{extension}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the referenced vertex extension. + * Format: + * `projects/{project}/locations/{location}/extensions/{extension}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the referenced vertex extension. + * Format: + * `projects/{project}/locations/{location}/extensions/{extension}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/FunctionTool.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/FunctionTool.php new file mode 100644 index 000000000000..5d2244dee197 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/FunctionTool.php @@ -0,0 +1,183 @@ +google.cloud.dialogflow.v2.Tool.FunctionTool + */ +class FunctionTool extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the input of + * the function. This input is a JSON object that contains the function's + * parameters as properties of the object. + * + * Generated from protobuf field .google.protobuf.Struct input_schema = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $input_schema = null; + /** + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the output + * of the function. This output is a JSON object that contains the + * function's parameters as properties of the object. + * + * Generated from protobuf field .google.protobuf.Struct output_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_schema = null; + /** + * Optional. The method type of the function. If not specified, the default + * value is GET. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.MethodType method_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $method_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $input_schema + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the input of + * the function. This input is a JSON object that contains the function's + * parameters as properties of the object. + * @type \Google\Protobuf\Struct $output_schema + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the output + * of the function. This output is a JSON object that contains the + * function's parameters as properties of the object. + * @type int $method_type + * Optional. The method type of the function. If not specified, the default + * value is GET. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the input of + * the function. This input is a JSON object that contains the function's + * parameters as properties of the object. + * + * Generated from protobuf field .google.protobuf.Struct input_schema = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getInputSchema() + { + return $this->input_schema; + } + + public function hasInputSchema() + { + return isset($this->input_schema); + } + + public function clearInputSchema() + { + unset($this->input_schema); + } + + /** + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the input of + * the function. This input is a JSON object that contains the function's + * parameters as properties of the object. + * + * Generated from protobuf field .google.protobuf.Struct input_schema = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setInputSchema($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->input_schema = $var; + + return $this; + } + + /** + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the output + * of the function. This output is a JSON object that contains the + * function's parameters as properties of the object. + * + * Generated from protobuf field .google.protobuf.Struct output_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getOutputSchema() + { + return $this->output_schema; + } + + public function hasOutputSchema() + { + return isset($this->output_schema); + } + + public function clearOutputSchema() + { + unset($this->output_schema); + } + + /** + * Optional. The JSON schema is encapsulated in a + * [google.protobuf.Struct][google.protobuf.Struct] to describe the output + * of the function. This output is a JSON object that contains the + * function's parameters as properties of the object. + * + * Generated from protobuf field .google.protobuf.Struct output_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setOutputSchema($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->output_schema = $var; + + return $this; + } + + /** + * Optional. The method type of the function. If not specified, the default + * value is GET. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.MethodType method_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMethodType() + { + return $this->method_type; + } + + /** + * Optional. The method type of the function. If not specified, the default + * value is GET. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.MethodType method_type = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMethodType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\MethodType::class); + $this->method_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/MethodType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/MethodType.php new file mode 100644 index 000000000000..61240cd59cac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/MethodType.php @@ -0,0 +1,82 @@ +google.cloud.dialogflow.v2.Tool.MethodType + */ +class MethodType +{ + /** + * Unspecified. + * + * Generated from protobuf enum METHOD_TYPE_UNSPECIFIED = 0; + */ + const METHOD_TYPE_UNSPECIFIED = 0; + /** + * GET method. + * + * Generated from protobuf enum GET = 1; + */ + const GET = 1; + /** + * POST method. + * + * Generated from protobuf enum POST = 2; + */ + const POST = 2; + /** + * PUT method. + * + * Generated from protobuf enum PUT = 3; + */ + const PUT = 3; + /** + * DELETE method. + * + * Generated from protobuf enum DELETE = 4; + */ + const DELETE = 4; + /** + * PATCH method. + * + * Generated from protobuf enum PATCH = 5; + */ + const PATCH = 5; + + private static $valueToName = [ + self::METHOD_TYPE_UNSPECIFIED => 'METHOD_TYPE_UNSPECIFIED', + self::GET => 'GET', + self::POST => 'POST', + self::PUT => 'PUT', + self::DELETE => 'DELETE', + self::PATCH => 'PATCH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/OpenApiTool.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/OpenApiTool.php new file mode 100644 index 000000000000..88f6df63a59f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/OpenApiTool.php @@ -0,0 +1,208 @@ +google.cloud.dialogflow.v2.Tool.OpenApiTool + */ +class OpenApiTool extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Authentication information required by the API. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication authentication = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authentication = null; + /** + * Optional. TLS configuration for the HTTPS verification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.TLSConfig tls_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tls_config = null; + /** + * Optional. Service Directory configuration. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig service_directory_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_directory_config = null; + protected $schema; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text_schema + * Required. The OpenAPI schema specified as a text. + * @type \Google\Cloud\Dialogflow\V2\Tool\Authentication $authentication + * Optional. Authentication information required by the API. + * @type \Google\Cloud\Dialogflow\V2\Tool\TLSConfig $tls_config + * Optional. TLS configuration for the HTTPS verification. + * @type \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig $service_directory_config + * Optional. Service Directory configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The OpenAPI schema specified as a text. + * + * Generated from protobuf field string text_schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTextSchema() + { + return $this->readOneof(1); + } + + public function hasTextSchema() + { + return $this->hasOneof(1); + } + + /** + * Required. The OpenAPI schema specified as a text. + * + * Generated from protobuf field string text_schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTextSchema($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Authentication information required by the API. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication authentication = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Tool\Authentication|null + */ + public function getAuthentication() + { + return $this->authentication; + } + + public function hasAuthentication() + { + return isset($this->authentication); + } + + public function clearAuthentication() + { + unset($this->authentication); + } + + /** + * Optional. Authentication information required by the API. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.Authentication authentication = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Tool\Authentication $var + * @return $this + */ + public function setAuthentication($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication::class); + $this->authentication = $var; + + return $this; + } + + /** + * Optional. TLS configuration for the HTTPS verification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.TLSConfig tls_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Tool\TLSConfig|null + */ + public function getTlsConfig() + { + return $this->tls_config; + } + + public function hasTlsConfig() + { + return isset($this->tls_config); + } + + public function clearTlsConfig() + { + unset($this->tls_config); + } + + /** + * Optional. TLS configuration for the HTTPS verification. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.TLSConfig tls_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Tool\TLSConfig $var + * @return $this + */ + public function setTlsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\TLSConfig::class); + $this->tls_config = $var; + + return $this; + } + + /** + * Optional. Service Directory configuration. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig service_directory_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig|null + */ + public function getServiceDirectoryConfig() + { + return $this->service_directory_config; + } + + public function hasServiceDirectoryConfig() + { + return isset($this->service_directory_config); + } + + public function clearServiceDirectoryConfig() + { + unset($this->service_directory_config); + } + + /** + * Optional. Service Directory configuration. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig service_directory_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig $var + * @return $this + */ + public function setServiceDirectoryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig::class); + $this->service_directory_config = $var; + + return $this; + } + + /** + * @return string + */ + public function getSchema() + { + return $this->whichOneof("schema"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ServiceDirectoryConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ServiceDirectoryConfig.php new file mode 100644 index 000000000000..fd4e140013fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/ServiceDirectoryConfig.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig + */ +class ServiceDirectoryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of [Service + * Directory](https://cloud.google.com/service-directory) service. + * Format: + * `projects//locations//namespaces//services/`. + * `LocationID` of the service directory must be the same as the location + * of the tool. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Required. The name of [Service + * Directory](https://cloud.google.com/service-directory) service. + * Format: + * `projects//locations//namespaces//services/`. + * `LocationID` of the service directory must be the same as the location + * of the tool. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of [Service + * Directory](https://cloud.google.com/service-directory) service. + * Format: + * `projects//locations//namespaces//services/`. + * `LocationID` of the service directory must be the same as the location + * of the tool. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. The name of [Service + * Directory](https://cloud.google.com/service-directory) service. + * Format: + * `projects//locations//namespaces//services/`. + * `LocationID` of the service directory must be the same as the location + * of the tool. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig.php new file mode 100644 index 000000000000..4dce0690b141 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.Tool.TLSConfig + */ +class TLSConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies a list of allowed custom CA certificates for HTTPS + * verification. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool.TLSConfig.CACert ca_certs = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $ca_certs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Tool\TLSConfig\CACert[] $ca_certs + * Required. Specifies a list of allowed custom CA certificates for HTTPS + * verification. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies a list of allowed custom CA certificates for HTTPS + * verification. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool.TLSConfig.CACert ca_certs = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Tool\TLSConfig\CACert> + */ + public function getCaCerts() + { + return $this->ca_certs; + } + + /** + * Required. Specifies a list of allowed custom CA certificates for HTTPS + * verification. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Tool.TLSConfig.CACert ca_certs = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Tool\TLSConfig\CACert[] $var + * @return $this + */ + public function setCaCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Tool\TLSConfig\CACert::class); + $this->ca_certs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig/CACert.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig/CACert.php new file mode 100644 index 000000000000..0c3007240c54 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Tool/TLSConfig/CACert.php @@ -0,0 +1,149 @@ +google.cloud.dialogflow.v2.Tool.TLSConfig.CACert + */ +class CACert extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the allowed custom CA certificates. This + * can be used to disambiguate the custom CA certificates. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The allowed custom CA certificates (in DER format) for + * HTTPS verification. This overrides the default SSL trust store. If this + * is empty or unspecified, Dialogflow will use Google's default trust + * store to verify certificates. N.B. Make sure the HTTPS server + * certificates are signed with "subject alt name". For instance a + * certificate can be self-signed using the following command, + * ``` + * openssl x509 -req -days 200 -in example.com.csr \ + * -signkey example.com.key \ + * -out example.com.crt \ + * -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + * ``` + * + * Generated from protobuf field bytes cert = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cert = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Required. The name of the allowed custom CA certificates. This + * can be used to disambiguate the custom CA certificates. + * @type string $cert + * Required. The allowed custom CA certificates (in DER format) for + * HTTPS verification. This overrides the default SSL trust store. If this + * is empty or unspecified, Dialogflow will use Google's default trust + * store to verify certificates. N.B. Make sure the HTTPS server + * certificates are signed with "subject alt name". For instance a + * certificate can be self-signed using the following command, + * ``` + * openssl x509 -req -days 200 -in example.com.csr \ + * -signkey example.com.key \ + * -out example.com.crt \ + * -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + * ``` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the allowed custom CA certificates. This + * can be used to disambiguate the custom CA certificates. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the allowed custom CA certificates. This + * can be used to disambiguate the custom CA certificates. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The allowed custom CA certificates (in DER format) for + * HTTPS verification. This overrides the default SSL trust store. If this + * is empty or unspecified, Dialogflow will use Google's default trust + * store to verify certificates. N.B. Make sure the HTTPS server + * certificates are signed with "subject alt name". For instance a + * certificate can be self-signed using the following command, + * ``` + * openssl x509 -req -days 200 -in example.com.csr \ + * -signkey example.com.key \ + * -out example.com.crt \ + * -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + * ``` + * + * Generated from protobuf field bytes cert = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCert() + { + return $this->cert; + } + + /** + * Required. The allowed custom CA certificates (in DER format) for + * HTTPS verification. This overrides the default SSL trust store. If this + * is empty or unspecified, Dialogflow will use Google's default trust + * store to verify certificates. N.B. Make sure the HTTPS server + * certificates are signed with "subject alt name". For instance a + * certificate can be self-signed using the following command, + * ``` + * openssl x509 -req -days 200 -in example.com.csr \ + * -signkey example.com.key \ + * -out example.com.crt \ + * -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + * ``` + * + * Generated from protobuf field bytes cert = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCert($var) + { + GPBUtil::checkString($var, False); + $this->cert = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall.php new file mode 100644 index 000000000000..6e75d3912ae2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall.php @@ -0,0 +1,456 @@ +google.cloud.dialogflow.v2.ToolCall + */ +class ToolCall extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A human readable short name of the tool, to be shown on the UI. + * + * Generated from protobuf field string tool_display_name = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tool_display_name = ''; + /** + * Optional. A human readable description of the tool. + * + * Generated from protobuf field string tool_display_details = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tool_display_details = ''; + /** + * Optional. The name of the tool's action associated with this call. + * + * Generated from protobuf field string action = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $action = ''; + /** + * Optional. The action's input parameters. + * + * Generated from protobuf field .google.protobuf.Struct input_parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $input_parameters = null; + /** + * Output only. Create time of the tool call. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. The answer record associated with this tool call. + * + * Generated from protobuf field string answer_record = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $answer_record = ''; + /** + * Output only. State of the tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCall.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tool + * Optional. The [tool][google.cloud.dialogflow.v2.Tool] associated with + * this call. Format: + * `projects//locations//tools/`. + * @type string $ces_tool + * Optional. CES tool name for this call. + * Format: + * `projects//locations//apps//tools/`. + * @type string $ces_toolset + * Optional. CES toolset name for this call. + * Format: + * `projects//locations//apps//toolsets/ToolsetID>`. + * @type string $ces_app + * Optional. CES app name for this call. + * Format: + * `projects//locations//apps/`. + * @type string $tool_display_name + * Optional. A human readable short name of the tool, to be shown on the UI. + * @type string $tool_display_details + * Optional. A human readable description of the tool. + * @type string $action + * Optional. The name of the tool's action associated with this call. + * @type \Google\Protobuf\Struct $input_parameters + * Optional. The action's input parameters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time of the tool call. + * @type string $answer_record + * Optional. The answer record associated with this tool call. + * @type int $state + * Output only. State of the tool call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ToolCall::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The [tool][google.cloud.dialogflow.v2.Tool] associated with + * this call. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTool() + { + return $this->readOneof(1); + } + + public function hasTool() + { + return $this->hasOneof(1); + } + + /** + * Optional. The [tool][google.cloud.dialogflow.v2.Tool] associated with + * this call. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTool($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. CES tool name for this call. + * Format: + * `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesTool() + { + return $this->readOneof(11); + } + + public function hasCesTool() + { + return $this->hasOneof(11); + } + + /** + * Optional. CES tool name for this call. + * Format: + * `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesTool($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Optional. CES toolset name for this call. + * Format: + * `projects//locations//apps//toolsets/ToolsetID>`. + * + * Generated from protobuf field string ces_toolset = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesToolset() + { + return $this->readOneof(12); + } + + public function hasCesToolset() + { + return $this->hasOneof(12); + } + + /** + * Optional. CES toolset name for this call. + * Format: + * `projects//locations//apps//toolsets/ToolsetID>`. + * + * Generated from protobuf field string ces_toolset = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesToolset($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Optional. CES app name for this call. + * Format: + * `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesApp() + { + return $this->readOneof(8); + } + + public function hasCesApp() + { + return $this->hasOneof(8); + } + + /** + * Optional. CES app name for this call. + * Format: + * `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesApp($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Optional. A human readable short name of the tool, to be shown on the UI. + * + * Generated from protobuf field string tool_display_name = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getToolDisplayName() + { + return $this->tool_display_name; + } + + /** + * Optional. A human readable short name of the tool, to be shown on the UI. + * + * Generated from protobuf field string tool_display_name = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setToolDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->tool_display_name = $var; + + return $this; + } + + /** + * Optional. A human readable description of the tool. + * + * Generated from protobuf field string tool_display_details = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getToolDisplayDetails() + { + return $this->tool_display_details; + } + + /** + * Optional. A human readable description of the tool. + * + * Generated from protobuf field string tool_display_details = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setToolDisplayDetails($var) + { + GPBUtil::checkString($var, True); + $this->tool_display_details = $var; + + return $this; + } + + /** + * Optional. The name of the tool's action associated with this call. + * + * Generated from protobuf field string action = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Optional. The name of the tool's action associated with this call. + * + * Generated from protobuf field string action = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * Optional. The action's input parameters. + * + * Generated from protobuf field .google.protobuf.Struct input_parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getInputParameters() + { + return $this->input_parameters; + } + + public function hasInputParameters() + { + return isset($this->input_parameters); + } + + public function clearInputParameters() + { + unset($this->input_parameters); + } + + /** + * Optional. The action's input parameters. + * + * Generated from protobuf field .google.protobuf.Struct input_parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setInputParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->input_parameters = $var; + + return $this; + } + + /** + * Output only. Create time of the tool call. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create time of the tool call. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The answer record associated with this tool call. + * + * Generated from protobuf field string answer_record = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Optional. The answer record associated with this tool call. + * + * Generated from protobuf field string answer_record = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * Output only. State of the tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCall.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the tool call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCall.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ToolCall\State::class); + $this->state = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall/State.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall/State.php new file mode 100644 index 000000000000..652a8b310405 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCall/State.php @@ -0,0 +1,61 @@ +google.cloud.dialogflow.v2.ToolCall.State + */ +class State +{ + /** + * Default value. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The tool call has been triggered. + * + * Generated from protobuf enum TRIGGERED = 1; + */ + const TRIGGERED = 1; + /** + * The tool call requires confirmation from a human. + * + * Generated from protobuf enum NEEDS_CONFIRMATION = 2; + */ + const NEEDS_CONFIRMATION = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::TRIGGERED => 'TRIGGERED', + self::NEEDS_CONFIRMATION => 'NEEDS_CONFIRMATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult.php new file mode 100644 index 000000000000..065ac453f0e8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult.php @@ -0,0 +1,421 @@ +google.cloud.dialogflow.v2.ToolCallResult + */ +class ToolCallResult extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the tool's action associated with this call. + * + * Generated from protobuf field string action = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $action = ''; + /** + * Output only. Create time of the tool call result. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. The answer record associated with this tool call result. + * + * Generated from protobuf field string answer_record = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $answer_record = ''; + protected $source; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tool + * Optional. The [tool][google.cloud.dialogflow.v2.Tool] associated with + * this call. Format: + * `projects//locations//tools/`. + * @type string $ces_toolset + * Optional. CES toolset name for this call. + * Format: + * `projects//locations//apps//toolsets/ToolsetID>`. + * @type string $ces_tool + * Optional. CES tool name for this call. + * Format: + * `projects//locations//apps//tools/`. + * @type string $ces_app + * Optional. CES app name for this call. + * Format: + * `projects//locations//apps/`. + * @type string $action + * Optional. The name of the tool's action associated with this call. + * @type \Google\Cloud\Dialogflow\V2\ToolCallResult\Error $error + * The tool call's error. + * @type string $raw_content + * Only populated if the response content is not utf-8 encoded. + * (by definition byte fields are base64 encoded). + * @type string $content + * Only populated if the response content is utf-8 encoded. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create time of the tool call result. + * @type string $answer_record + * Optional. The answer record associated with this tool call result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ToolCall::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The [tool][google.cloud.dialogflow.v2.Tool] associated with + * this call. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getTool() + { + return $this->readOneof(1); + } + + public function hasTool() + { + return $this->hasOneof(1); + } + + /** + * Optional. The [tool][google.cloud.dialogflow.v2.Tool] associated with + * this call. Format: + * `projects//locations//tools/`. + * + * Generated from protobuf field string tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTool($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. CES toolset name for this call. + * Format: + * `projects//locations//apps//toolsets/ToolsetID>`. + * + * Generated from protobuf field string ces_toolset = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesToolset() + { + return $this->readOneof(13); + } + + public function hasCesToolset() + { + return $this->hasOneof(13); + } + + /** + * Optional. CES toolset name for this call. + * Format: + * `projects//locations//apps//toolsets/ToolsetID>`. + * + * Generated from protobuf field string ces_toolset = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesToolset($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Optional. CES tool name for this call. + * Format: + * `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesTool() + { + return $this->readOneof(12); + } + + public function hasCesTool() + { + return $this->hasOneof(12); + } + + /** + * Optional. CES tool name for this call. + * Format: + * `projects//locations//apps//tools/`. + * + * Generated from protobuf field string ces_tool = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesTool($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Optional. CES app name for this call. + * Format: + * `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCesApp() + { + return $this->readOneof(11); + } + + public function hasCesApp() + { + return $this->hasOneof(11); + } + + /** + * Optional. CES app name for this call. + * Format: + * `projects//locations//apps/`. + * + * Generated from protobuf field string ces_app = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCesApp($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Optional. The name of the tool's action associated with this call. + * + * Generated from protobuf field string action = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Optional. The name of the tool's action associated with this call. + * + * Generated from protobuf field string action = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * The tool call's error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCallResult.Error error = 3; + * @return \Google\Cloud\Dialogflow\V2\ToolCallResult\Error|null + */ + public function getError() + { + return $this->readOneof(3); + } + + public function hasError() + { + return $this->hasOneof(3); + } + + /** + * The tool call's error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ToolCallResult.Error error = 3; + * @param \Google\Cloud\Dialogflow\V2\ToolCallResult\Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ToolCallResult\Error::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Only populated if the response content is not utf-8 encoded. + * (by definition byte fields are base64 encoded). + * + * Generated from protobuf field bytes raw_content = 5; + * @return string + */ + public function getRawContent() + { + return $this->readOneof(5); + } + + public function hasRawContent() + { + return $this->hasOneof(5); + } + + /** + * Only populated if the response content is not utf-8 encoded. + * (by definition byte fields are base64 encoded). + * + * Generated from protobuf field bytes raw_content = 5; + * @param string $var + * @return $this + */ + public function setRawContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Only populated if the response content is utf-8 encoded. + * + * Generated from protobuf field string content = 6; + * @return string + */ + public function getContent() + { + return $this->readOneof(6); + } + + public function hasContent() + { + return $this->hasOneof(6); + } + + /** + * Only populated if the response content is utf-8 encoded. + * + * Generated from protobuf field string content = 6; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. Create time of the tool call result. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create time of the tool call result. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. The answer record associated with this tool call result. + * + * Generated from protobuf field string answer_record = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Optional. The answer record associated with this tool call result. + * + * Generated from protobuf field string answer_record = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult/Error.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult/Error.php new file mode 100644 index 000000000000..2476e6717cce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolCallResult/Error.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ToolCallResult.Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The error message of the function. + * + * Generated from protobuf field string message = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message + * Optional. The error message of the function. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ToolCall::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The error message of the function. + * + * Generated from protobuf field string message = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Optional. The error message of the function. + * + * Generated from protobuf field string message = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolsetTool.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolsetTool.php new file mode 100644 index 000000000000..68dfbb7bdbf4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ToolsetTool.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.ToolsetTool + */ +class ToolsetTool extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the toolset to retrieve the schema for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + * + * Generated from protobuf field string toolset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $toolset = ''; + /** + * Optional. The operationId field of the OpenAPI endpoint. The operationId + * must be present in the toolset's definition. + * + * Generated from protobuf field string operation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $operation_id = ''; + /** + * Optional. Indicates whether the tool requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confirmation_requirement = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $toolset + * Required. The name of the toolset to retrieve the schema for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + * @type string $operation_id + * Optional. The operationId field of the OpenAPI endpoint. The operationId + * must be present in the toolset's definition. + * @type int $confirmation_requirement + * Optional. Indicates whether the tool requires human confirmation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Toolset::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the toolset to retrieve the schema for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + * + * Generated from protobuf field string toolset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getToolset() + { + return $this->toolset; + } + + /** + * Required. The name of the toolset to retrieve the schema for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + * + * Generated from protobuf field string toolset = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setToolset($var) + { + GPBUtil::checkString($var, True); + $this->toolset = $var; + + return $this; + } + + /** + * Optional. The operationId field of the OpenAPI endpoint. The operationId + * must be present in the toolset's definition. + * + * Generated from protobuf field string operation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOperationId() + { + return $this->operation_id; + } + + /** + * Optional. The operationId field of the OpenAPI endpoint. The operationId + * must be present in the toolset's definition. + * + * Generated from protobuf field string operation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOperationId($var) + { + GPBUtil::checkString($var, True); + $this->operation_id = $var; + + return $this; + } + + /** + * Optional. Indicates whether the tool requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConfirmationRequirement() + { + return $this->confirmation_requirement; + } + + /** + * Optional. Indicates whether the tool requires human confirmation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement confirmation_requirement = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConfirmationRequirement($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\ConfirmationRequirement::class); + $this->confirmation_requirement = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php new file mode 100644 index 000000000000..921f039c5b17 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.TrainAgentRequest + */ +class TrainAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The project that the agent to train is associated with. + * Format: `projects/`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\TrainAgentRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php new file mode 100644 index 000000000000..08b1a5a2c8f4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.TriggerEvent + */ +class TriggerEvent +{ + /** + * Default value for TriggerEvent. + * + * Generated from protobuf enum TRIGGER_EVENT_UNSPECIFIED = 0; + */ + const TRIGGER_EVENT_UNSPECIFIED = 0; + /** + * Triggers when each chat message or voice utterance ends. + * + * Generated from protobuf enum END_OF_UTTERANCE = 1; + */ + const END_OF_UTTERANCE = 1; + /** + * Triggers on the conversation manually by API calls, such as + * Conversations.GenerateStatelessSuggestion and + * Conversations.GenerateSuggestions. + * + * Generated from protobuf enum MANUAL_CALL = 2; + */ + const MANUAL_CALL = 2; + /** + * Triggers after each customer message only. + * + * Generated from protobuf enum CUSTOMER_MESSAGE = 3; + */ + const CUSTOMER_MESSAGE = 3; + /** + * Triggers after each agent message only. + * + * Generated from protobuf enum AGENT_MESSAGE = 4; + */ + const AGENT_MESSAGE = 4; + + private static $valueToName = [ + self::TRIGGER_EVENT_UNSPECIFIED => 'TRIGGER_EVENT_UNSPECIFIED', + self::END_OF_UTTERANCE => 'END_OF_UTTERANCE', + self::MANUAL_CALL => 'MANUAL_CALL', + self::CUSTOMER_MESSAGE => 'CUSTOMER_MESSAGE', + self::AGENT_MESSAGE => 'AGENT_MESSAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php new file mode 100644 index 000000000000..29cc7456934a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php @@ -0,0 +1,165 @@ +google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata + */ +class UndeployConversationModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + */ + protected $conversation_model = ''; + /** + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + */ + protected $done_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_model + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * @type \Google\Protobuf\Timestamp $create_time + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * @type \Google\Protobuf\Timestamp $done_time + * The time when the operation finished. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @return string + */ + public function getConversationModel() + { + return $this->conversation_model; + } + + /** + * The resource name of the conversation model. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string conversation_model = 1; + * @param string $var + * @return $this + */ + public function setConversationModel($var) + { + GPBUtil::checkString($var, True); + $this->conversation_model = $var; + + return $this; + } + + /** + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Timestamp when the request to undeploy conversation model was submitted. + * The time is measured on server side. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDoneTime() + { + return $this->done_time; + } + + public function hasDoneTime() + { + return isset($this->done_time); + } + + public function clearDoneTime() + { + unset($this->done_time); + } + + /** + * The time when the operation finished. + * + * Generated from protobuf field .google.protobuf.Timestamp done_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDoneTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->done_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php new file mode 100644 index 000000000000..9d5b2ba6ea03 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.UndeployConversationModelRequest + */ +class UndeployConversationModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php new file mode 100644 index 000000000000..4fe66e6369b0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateAnswerRecordRequest + */ +class UpdateAnswerRecordRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Answer record to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerRecord answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_record = null; + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\AnswerRecord $answerRecord Required. Answer record to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateAnswerRecordRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\AnswerRecord $answerRecord, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAnswerRecord($answerRecord) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\AnswerRecord $answer_record + * Required. Answer record to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Required. Answer record to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerRecord answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\AnswerRecord|null + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + public function hasAnswerRecord() + { + return isset($this->answer_record); + } + + public function clearAnswerRecord() + { + unset($this->answer_record); + } + + /** + * Required. Answer record to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AnswerRecord answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\AnswerRecord $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AnswerRecord::class); + $this->answer_record = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php new file mode 100644 index 000000000000..e1e54ad98840 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateContextRequest + */ +class UpdateContextRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The context to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $context = null; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Context $context Required. The context to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateContextRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Context $context, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setContext($context) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Context $context + * Required. The context to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The context to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Context|null + */ + public function getContext() + { + return $this->context; + } + + public function hasContext() + { + return isset($this->context); + } + + public function clearContext() + { + unset($this->context); + } + + /** + * Required. The context to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Context context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Context $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Context::class); + $this->context = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php new file mode 100644 index 000000000000..33c4d55cfb0d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateConversationProfileRequest + */ +class UpdateConversationProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation profile to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + /** + * Required. The mask to control which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile Required. The conversation profile to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateConversationProfileRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\ConversationProfile $conversationProfile, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setConversationProfile($conversationProfile) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. The conversation profile to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation profile to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. The conversation profile to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The mask to control which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php new file mode 100644 index 000000000000..4592d85f18d6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.UpdateDocumentRequest + */ +class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The document to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document = null; + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Document $document Required. The document to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateDocumentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Document $document, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDocument($document) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Document $document + * Required. The document to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. The document to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Required. The document to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Document::class); + $this->document = $var; + + return $this; + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php new file mode 100644 index 000000000000..626691fd50a7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php @@ -0,0 +1,204 @@ +google.cloud.dialogflow.v2.UpdateEntityTypeRequest + */ +class UpdateEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_type = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateEntityTypeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\EntityType $entityType): self + { + return (new self()) + ->setEntityType($entityType); + } + + /** + * @param \Google\Cloud\Dialogflow\V2\EntityType $entityType Required. The entity type to update. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\UpdateEntityTypeRequest + * + * @experimental + */ + public static function buildFromEntityTypeLanguageCode(\Google\Cloud\Dialogflow\V2\EntityType $entityType, string $languageCode): self + { + return (new self()) + ->setEntityType($entityType) + ->setLanguageCode($languageCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EntityType $entity_type + * Required. The entity type to update. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EntityType|null + */ + public function getEntityType() + { + return $this->entity_type; + } + + public function hasEntityType() + { + return isset($this->entity_type); + } + + public function clearEntityType() + { + unset($this->entity_type); + } + + /** + * Required. The entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EntityType entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EntityType $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EntityType::class); + $this->entity_type = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php new file mode 100644 index 000000000000..c8ed4bbc973e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php @@ -0,0 +1,168 @@ +google.cloud.dialogflow.v2.UpdateEnvironmentRequest + */ +class UpdateEnvironmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The environment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment = null; + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * + * Generated from protobuf field bool allow_load_to_draft_and_discard_changes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_load_to_draft_and_discard_changes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Environment $environment + * Required. The environment to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. + * @type bool $allow_load_to_draft_and_discard_changes + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Environment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The environment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Required. The environment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Environment environment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Environment::class); + $this->environment = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * + * Generated from protobuf field bool allow_load_to_draft_and_discard_changes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowLoadToDraftAndDiscardChanges() + { + return $this->allow_load_to_draft_and_discard_changes; + } + + /** + * Optional. This field is used to prevent accidental overwrite of the default + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the default environment (environment ID = `-`). + * + * Generated from protobuf field bool allow_load_to_draft_and_discard_changes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowLoadToDraftAndDiscardChanges($var) + { + GPBUtil::checkBool($var); + $this->allow_load_to_draft_and_discard_changes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php new file mode 100644 index 000000000000..b046abf8107c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.UpdateFulfillmentRequest + */ +class UpdateFulfillmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The fulfillment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fulfillment = null; + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment Required. The fulfillment to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateFulfillmentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFulfillment($fulfillment) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Fulfillment $fulfillment + * Required. The fulfillment to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Fulfillment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The fulfillment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Fulfillment|null + */ + public function getFulfillment() + { + return $this->fulfillment; + } + + public function hasFulfillment() + { + return isset($this->fulfillment); + } + + public function clearFulfillment() + { + unset($this->fulfillment); + } + + /** + * Required. The fulfillment to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Fulfillment fulfillment = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Fulfillment $var + * @return $this + */ + public function setFulfillment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Fulfillment::class); + $this->fulfillment = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php new file mode 100644 index 000000000000..b819a03dbda7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php @@ -0,0 +1,141 @@ +google.cloud.dialogflow.v2.UpdateGeneratorRequest + */ +class UpdateGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator = null; + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateGeneratorRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Generator $generator, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerator($generator) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->generator; + } + + public function hasGenerator() + { + return isset($this->generator); + } + + public function clearGenerator() + { + unset($this->generator); + } + + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generator = $var; + + return $this; + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php new file mode 100644 index 000000000000..ce538eb262d5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php @@ -0,0 +1,246 @@ +google.cloud.dialogflow.v2.UpdateIntentRequest + */ +class UpdateIntentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The intent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $intent = null; + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $intent_view = 0; + + /** + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to update. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * @return \Google\Cloud\Dialogflow\V2\UpdateIntentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Intent $intent, string $languageCode): self + { + return (new self()) + ->setIntent($intent) + ->setLanguageCode($languageCode); + } + + /** + * @param \Google\Cloud\Dialogflow\V2\Intent $intent Required. The intent to update. + * @param string $languageCode Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateIntentRequest + * + * @experimental + */ + public static function buildFromIntentLanguageCodeUpdateMask(\Google\Cloud\Dialogflow\V2\Intent $intent, string $languageCode, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setIntent($intent) + ->setLanguageCode($languageCode) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Intent $intent + * Required. The intent to update. + * @type string $language_code + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * @type int $intent_view + * Optional. The resource view to apply to the returned intent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The intent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Intent|null + */ + public function getIntent() + { + return $this->intent; + } + + public function hasIntent() + { + return isset($this->intent); + } + + public function clearIntent() + { + unset($this->intent); + } + + /** + * Required. The intent to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Intent $var + * @return $this + */ + public function setIntent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Intent::class); + $this->intent = $var; + + return $this; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIntentView() + { + return $this->intent_view; + } + + /** + * Optional. The resource view to apply to the returned intent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentView intent_view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIntentView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\IntentView::class); + $this->intent_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php new file mode 100644 index 000000000000..334582578a26 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php @@ -0,0 +1,147 @@ +google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + */ +class UpdateKnowledgeBaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The knowledge base to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $knowledge_base = null; + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase Required. The knowledge base to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateKnowledgeBaseRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledgeBase, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setKnowledgeBase($knowledgeBase) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeBase $knowledge_base + * Required. The knowledge base to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\KnowledgeBase::initOnce(); + parent::__construct($data); + } + + /** + * Required. The knowledge base to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeBase|null + */ + public function getKnowledgeBase() + { + return $this->knowledge_base; + } + + public function hasKnowledgeBase() + { + return isset($this->knowledge_base); + } + + public function clearKnowledgeBase() + { + unset($this->knowledge_base); + } + + /** + * Required. The knowledge base to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeBase knowledge_base = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeBase $var + * @return $this + */ + public function setKnowledgeBase($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeBase::class); + $this->knowledge_base = $var; + + return $this; + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php new file mode 100644 index 000000000000..364ac50d1321 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php @@ -0,0 +1,137 @@ +google.cloud.dialogflow.v2.UpdateParticipantRequest + */ +class UpdateParticipantRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The participant to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $participant = null; + /** + * Required. The mask to specify which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Participant $participant Required. The participant to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to specify which fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateParticipantRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Participant $participant, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setParticipant($participant) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Participant $participant + * Required. The participant to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to specify which fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The participant to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Participant|null + */ + public function getParticipant() + { + return $this->participant; + } + + public function hasParticipant() + { + return isset($this->participant); + } + + public function clearParticipant() + { + unset($this->participant); + } + + /** + * Required. The participant to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Participant participant = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Participant $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Participant::class); + $this->participant = $var; + + return $this; + } + + /** + * Required. The mask to specify which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to specify which fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php new file mode 100644 index 000000000000..5cc742623aca --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest + */ +class UpdateSessionEntityTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The session entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_entity_type = null; + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType Required. The session entity type to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateSessionEntityTypeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType): self + { + return (new self()) + ->setSessionEntityType($sessionEntityType); + } + + /** + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType Required. The session entity type to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateSessionEntityTypeRequest + * + * @experimental + */ + public static function buildFromSessionEntityTypeUpdateMask(\Google\Cloud\Dialogflow\V2\SessionEntityType $sessionEntityType, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSessionEntityType($sessionEntityType) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType $session_entity_type + * Required. The session entity type to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SessionEntityType::initOnce(); + parent::__construct($data); + } + + /** + * Required. The session entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\SessionEntityType|null + */ + public function getSessionEntityType() + { + return $this->session_entity_type; + } + + public function hasSessionEntityType() + { + return isset($this->session_entity_type); + } + + public function clearSessionEntityType() + { + unset($this->session_entity_type); + } + + /** + * Required. The session entity type to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SessionEntityType session_entity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType $var + * @return $this + */ + public function setSessionEntityType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_type = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSipTrunkRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSipTrunkRequest.php new file mode 100644 index 000000000000..aa6c6c0a1fab --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSipTrunkRequest.php @@ -0,0 +1,142 @@ +google.cloud.dialogflow.v2.UpdateSipTrunkRequest + */ +class UpdateSipTrunkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The SipTrunk to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipTrunk sip_trunk = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sip_trunk = null; + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\SipTrunk $sipTrunk Required. The SipTrunk to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateSipTrunkRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\SipTrunk $sipTrunk, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSipTrunk($sipTrunk) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SipTrunk $sip_trunk + * Required. The SipTrunk to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce(); + parent::__construct($data); + } + + /** + * Required. The SipTrunk to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipTrunk sip_trunk = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\SipTrunk|null + */ + public function getSipTrunk() + { + return $this->sip_trunk; + } + + public function hasSipTrunk() + { + return isset($this->sip_trunk); + } + + public function clearSipTrunk() + { + unset($this->sip_trunk); + } + + /** + * Required. The SipTrunk to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SipTrunk sip_trunk = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\SipTrunk $var + * @return $this + */ + public function setSipTrunk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SipTrunk::class); + $this->sip_trunk = $var; + + return $this; + } + + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateToolRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateToolRequest.php new file mode 100644 index 000000000000..8f7629aec936 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateToolRequest.php @@ -0,0 +1,146 @@ +google.cloud.dialogflow.v2.UpdateToolRequest + */ +class UpdateToolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The tool to update. + * The name field of tool is to identify the tool to + * update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool tool = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tool = null; + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Tool $tool Required. The tool to update. + * The name field of tool is to identify the tool to + * update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateToolRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Tool $tool, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setTool($tool) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Tool $tool + * Required. The tool to update. + * The name field of tool is to identify the tool to + * update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce(); + parent::__construct($data); + } + + /** + * Required. The tool to update. + * The name field of tool is to identify the tool to + * update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool tool = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Tool|null + */ + public function getTool() + { + return $this->tool; + } + + public function hasTool() + { + return isset($this->tool); + } + + public function clearTool() + { + unset($this->tool); + } + + /** + * Required. The tool to update. + * The name field of tool is to identify the tool to + * update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Tool tool = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Tool $var + * @return $this + */ + public function setTool($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool::class); + $this->tool = $var; + + return $this; + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php new file mode 100644 index 000000000000..df3cec02800e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.UpdateVersionRequest + */ +class UpdateVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $version = null; + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Version $version Required. The version to update. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param \Google\Protobuf\FieldMask $updateMask Required. The mask to control which fields get updated. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateVersionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Version $version, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setVersion($version) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Version $version + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The mask to control which fields get updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Version|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Version $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Version::class); + $this->version = $var; + + return $this; + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The mask to control which fields get updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php new file mode 100644 index 000000000000..88ee7756f452 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php @@ -0,0 +1,183 @@ +google.cloud.dialogflow.v2.ValidationError + */ +class ValidationError extends \Google\Protobuf\Internal\Message +{ + /** + * The severity of the error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ValidationError.Severity severity = 1; + */ + protected $severity = 0; + /** + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * + * Generated from protobuf field repeated string entries = 3; + */ + private $entries; + /** + * The detailed error message. + * + * Generated from protobuf field string error_message = 4; + */ + protected $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $severity + * The severity of the error. + * @type string[] $entries + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * @type string $error_message + * The detailed error message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ValidationResult::initOnce(); + parent::__construct($data); + } + + /** + * The severity of the error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ValidationError.Severity severity = 1; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * The severity of the error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ValidationError.Severity severity = 1; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\ValidationError\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * + * Generated from protobuf field repeated string entries = 3; + * @return RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * The names of the entries that the error is associated with. + * Format: + * - `projects//agent`, if the error is associated with the entire + * agent. + * - `projects//agent/intents/`, if the error is + * associated with certain intents. + * - `projects//agent/intents//trainingPhrases/`, if the error is associated with + * certain intent training phrases. + * - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + * - `projects//agent/entities/`, if the error is + * associated with certain entities. + * + * Generated from protobuf field repeated string entries = 3; + * @param string[] $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entries = $arr; + + return $this; + } + + /** + * The detailed error message. + * + * Generated from protobuf field string error_message = 4; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * The detailed error message. + * + * Generated from protobuf field string error_message = 4; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php new file mode 100644 index 000000000000..10e425a52612 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.ValidationError.Severity + */ +class Severity +{ + /** + * Not specified. This value should never be used. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * The agent doesn't follow Dialogflow best practices. + * + * Generated from protobuf enum INFO = 1; + */ + const INFO = 1; + /** + * The agent may not behave as expected. + * + * Generated from protobuf enum WARNING = 2; + */ + const WARNING = 2; + /** + * The agent may experience partial failures. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + /** + * The agent may completely fail. + * + * Generated from protobuf enum CRITICAL = 4; + */ + const CRITICAL = 4; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + self::CRITICAL => 'CRITICAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php new file mode 100644 index 000000000000..e8dbb6108073 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ValidationResult + */ +class ValidationResult extends \Google\Protobuf\Internal\Message +{ + /** + * Contains all validation errors. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ValidationError validation_errors = 1; + */ + private $validation_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ValidationError[] $validation_errors + * Contains all validation errors. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ValidationResult::initOnce(); + parent::__construct($data); + } + + /** + * Contains all validation errors. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ValidationError validation_errors = 1; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\ValidationError> + */ + public function getValidationErrors() + { + return $this->validation_errors; + } + + /** + * Contains all validation errors. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.ValidationError validation_errors = 1; + * @param \Google\Cloud\Dialogflow\V2\ValidationError[] $var + * @return $this + */ + public function setValidationErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\ValidationError::class); + $this->validation_errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php new file mode 100644 index 000000000000..2baf1ab89b81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php @@ -0,0 +1,254 @@ +google.cloud.dialogflow.v2.Version + */ +class Version extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. The developer-provided description of this version. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * + * Generated from protobuf field int32 version_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $version_number = 0; + /** + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version.VersionStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @type string $description + * Optional. The developer-provided description of this version. + * @type int $version_number + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * @type int $status + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Version::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this agent version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The developer-provided description of this version. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The developer-provided description of this version. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * + * Generated from protobuf field int32 version_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getVersionNumber() + { + return $this->version_number; + } + + /** + * Output only. The sequential number of this version. This field is read-only + * which means it cannot be set by create and update methods. + * + * Generated from protobuf field int32 version_number = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setVersionNumber($var) + { + GPBUtil::checkInt32($var); + $this->version_number = $var; + + return $this; + } + + /** + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time of this version. This field is read-only, + * i.e., it cannot be set by create and update methods. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version.VersionStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of this version. This field is read-only and cannot + * be set by create and update methods. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Version.VersionStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Version\VersionStatus::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php new file mode 100644 index 000000000000..d9ed33e8015d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.Version.VersionStatus + */ +class VersionStatus +{ + /** + * Not specified. This value is not used. + * + * Generated from protobuf enum VERSION_STATUS_UNSPECIFIED = 0; + */ + const VERSION_STATUS_UNSPECIFIED = 0; + /** + * Version is not ready to serve (e.g. training is in progress). + * + * Generated from protobuf enum IN_PROGRESS = 1; + */ + const IN_PROGRESS = 1; + /** + * Version is ready to serve. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * Version training failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::VERSION_STATUS_UNSPECIFIED => 'VERSION_STATUS_UNSPECIFIED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::READY => 'READY', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php new file mode 100644 index 000000000000..2532d01dc0c1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.VoiceSelectionParams + */ +class VoiceSelectionParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssml_gender = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * @type int $ssml_gender + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php new file mode 100644 index 000000000000..8f02fd122385 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php @@ -0,0 +1,217 @@ +google.cloud.dialogflow.v2.WebhookRequest + */ +class WebhookRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * + * Generated from protobuf field string session = 4; + */ + protected $session = ''; + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * + * Generated from protobuf field string response_id = 1; + */ + protected $response_id = ''; + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + */ + protected $query_result = null; + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OriginalDetectIntentRequest original_detect_intent_request = 3; + */ + protected $original_detect_intent_request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $session + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * @type string $response_id + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * @type \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest $original_detect_intent_request + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Webhook::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * + * Generated from protobuf field string session = 4; + * @return string + */ + public function getSession() + { + return $this->session; + } + + /** + * The unique identifier of detectIntent request session. + * Can be used to identify end-user inside webhook implementation. + * Format: `projects//agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. + * + * Generated from protobuf field string session = 4; + * @param string $var + * @return $this + */ + public function setSession($var) + { + GPBUtil::checkString($var, True); + $this->session = $var; + + return $this; + } + + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * + * Generated from protobuf field string response_id = 1; + * @return string + */ + public function getResponseId() + { + return $this->response_id; + } + + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + * + * Generated from protobuf field string response_id = 1; + * @param string $var + * @return $this + */ + public function setResponseId($var) + { + GPBUtil::checkString($var, True); + $this->response_id = $var; + + return $this; + } + + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->query_result; + } + + public function hasQueryResult() + { + return isset($this->query_result); + } + + public function clearQueryResult() + { + unset($this->query_result); + } + + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 2; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->query_result = $var; + + return $this; + } + + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OriginalDetectIntentRequest original_detect_intent_request = 3; + * @return \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest|null + */ + public function getOriginalDetectIntentRequest() + { + return $this->original_detect_intent_request; + } + + public function hasOriginalDetectIntentRequest() + { + return isset($this->original_detect_intent_request); + } + + public function clearOriginalDetectIntentRequest() + { + unset($this->original_detect_intent_request); + } + + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OriginalDetectIntentRequest original_detect_intent_request = 3; + * @param \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest $var + * @return $this + */ + public function setOriginalDetectIntentRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OriginalDetectIntentRequest::class); + $this->original_detect_intent_request = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php new file mode 100644 index 000000000000..d130819678d8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php @@ -0,0 +1,430 @@ +google.cloud.dialogflow.v2.WebhookResponse + */ +class WebhookResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * + * Generated from protobuf field string fulfillment_text = 1; + */ + protected $fulfillment_text = ''; + /** + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2; + */ + private $fulfillment_messages; + /** + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * + * Generated from protobuf field string source = 3; + */ + protected $source = ''; + /** + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf field .google.protobuf.Struct payload = 4; + */ + protected $payload = null; + /** + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 5; + */ + private $output_contexts; + /** + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput followup_event_input = 6; + */ + protected $followup_event_input = null; + /** + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10; + */ + private $session_entity_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fulfillment_text + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * @type \Google\Cloud\Dialogflow\V2\Intent\Message[] $fulfillment_messages + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * @type string $source + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * @type \Google\Protobuf\Struct $payload + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * @type \Google\Cloud\Dialogflow\V2\Context[] $output_contexts + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * @type \Google\Cloud\Dialogflow\V2\EventInput $followup_event_input + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * @type \Google\Cloud\Dialogflow\V2\SessionEntityType[] $session_entity_types + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Webhook::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * + * Generated from protobuf field string fulfillment_text = 1; + * @return string + */ + public function getFulfillmentText() + { + return $this->fulfillment_text; + } + + /** + * Optional. The text response message intended for the end-user. + * It is recommended to use `fulfillment_messages.text.text[0]` instead. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] + * sent to the integration or API caller. + * + * Generated from protobuf field string fulfillment_text = 1; + * @param string $var + * @return $this + */ + public function setFulfillmentText($var) + { + GPBUtil::checkString($var, True); + $this->fulfillment_text = $var; + + return $this; + } + + /** + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Intent\Message> + */ + public function getFulfillmentMessages() + { + return $this->fulfillment_messages; + } + + /** + * Optional. The rich response messages intended for the end-user. + * When provided, Dialogflow uses this field to populate + * [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2; + * @param \Google\Cloud\Dialogflow\V2\Intent\Message[] $var + * @return $this + */ + public function setFulfillmentMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class); + $this->fulfillment_messages = $arr; + + return $this; + } + + /** + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * + * Generated from protobuf field string source = 3; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * Optional. A custom field used to identify the webhook source. + * Arbitrary strings are supported. + * When provided, Dialogflow uses this field to populate + * [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] + * sent to the integration or API caller. + * + * Generated from protobuf field string source = 3; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf field .google.protobuf.Struct payload = 4; + * @return \Google\Protobuf\Struct|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * Optional. This field can be used to pass custom data from your webhook to + * the integration or API caller. Arbitrary JSON objects are supported. When + * provided, Dialogflow uses this field to populate + * [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] + * sent to the integration or API caller. This field is also used by the + * [Google Assistant + * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + * for rich response messages. + * See the format definition at [Google Assistant Dialogflow webhook + * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + * + * Generated from protobuf field .google.protobuf.Struct payload = 4; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->payload = $var; + + return $this; + } + + /** + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 5; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\Context> + */ + public function getOutputContexts() + { + return $this->output_contexts; + } + + /** + * Optional. The collection of output contexts that will overwrite currently + * active contexts for the session and reset their lifespans. + * When provided, Dialogflow uses this field to populate + * [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] + * sent to the integration or API caller. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 5; + * @param \Google\Cloud\Dialogflow\V2\Context[] $var + * @return $this + */ + public function setOutputContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Context::class); + $this->output_contexts = $arr; + + return $this; + } + + /** + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput followup_event_input = 6; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getFollowupEventInput() + { + return $this->followup_event_input; + } + + public function hasFollowupEventInput() + { + return isset($this->followup_event_input); + } + + public function clearFollowupEventInput() + { + unset($this->followup_event_input); + } + + /** + * Optional. Invokes the supplied events. + * When this field is set, Dialogflow ignores the `fulfillment_text`, + * `fulfillment_messages`, and `payload` fields. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput followup_event_input = 6; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setFollowupEventInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->followup_event_input = $var; + + return $this; + } + + /** + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10; + * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SessionEntityType> + */ + public function getSessionEntityTypes() + { + return $this->session_entity_types; + } + + /** + * Optional. Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session. Setting this data from a webhook overwrites + * the session entity types that have been set using `detectIntent`, + * `streamingDetectIntent` or + * [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] + * management methods. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10; + * @param \Google\Cloud\Dialogflow\V2\SessionEntityType[] $var + * @return $this + */ + public function setSessionEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SessionEntityType::class); + $this->session_entity_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php new file mode 100644 index 000000000000..a00ad78674a4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php @@ -0,0 +1,70 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function delete_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new DeleteAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + $agentsClient->deleteAgent($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + delete_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php new file mode 100644 index 000000000000..1f4686971b6b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php @@ -0,0 +1,105 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * @param string $agentUri The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ +function export_agent_sample(string $formattedParent, string $agentUri): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new ExportAgentRequest()) + ->setParent($formattedParent) + ->setAgentUri($agentUri); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->exportAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportAgentResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + $agentUri = '[AGENT_URI]'; + + export_agent_sample($formattedParent, $agentUri); +} +// [END dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php new file mode 100644 index 000000000000..eee7b032ce16 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php @@ -0,0 +1,72 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function get_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new GetAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var Agent $response */ + $response = $agentsClient->getAgent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + get_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php new file mode 100644 index 000000000000..7fcd2929bf07 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Agents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php new file mode 100644 index 000000000000..828dd3ca5629 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php @@ -0,0 +1,73 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function get_validation_result_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new GetValidationResultRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ValidationResult $response */ + $response = $agentsClient->getValidationResult($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + get_validation_result_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php new file mode 100644 index 000000000000..e6329b06e85c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php @@ -0,0 +1,107 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function import_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new ImportAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->importAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + import_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php new file mode 100644 index 000000000000..0f95543d65e0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Agents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php new file mode 100644 index 000000000000..fa4dbd83de89 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php @@ -0,0 +1,105 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function restore_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new RestoreAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->restoreAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + restore_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php new file mode 100644 index 000000000000..e5f948653dc8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php @@ -0,0 +1,83 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function search_agents_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new SearchAgentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $agentsClient->searchAgents($request); + + /** @var Agent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + search_agents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php new file mode 100644 index 000000000000..32a8fa8f2203 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php @@ -0,0 +1,102 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * @param string $agentDisplayName The name of this agent. + * @param string $agentDefaultLanguageCode The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * @param string $agentTimeZone The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + */ +function set_agent_sample( + string $formattedAgentParent, + string $agentDisplayName, + string $agentDefaultLanguageCode, + string $agentTimeZone +): void { + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $agent = (new Agent()) + ->setParent($formattedAgentParent) + ->setDisplayName($agentDisplayName) + ->setDefaultLanguageCode($agentDefaultLanguageCode) + ->setTimeZone($agentTimeZone); + $request = (new SetAgentRequest()) + ->setAgent($agent); + + // Call the API and handle any network failures. + try { + /** @var Agent $response */ + $response = $agentsClient->setAgent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedAgentParent = AgentsClient::projectName('[PROJECT]'); + $agentDisplayName = '[DISPLAY_NAME]'; + $agentDefaultLanguageCode = '[DEFAULT_LANGUAGE_CODE]'; + $agentTimeZone = '[TIME_ZONE]'; + + set_agent_sample( + $formattedAgentParent, + $agentDisplayName, + $agentDefaultLanguageCode, + $agentTimeZone + ); +} +// [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php new file mode 100644 index 000000000000..e33abb40beee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php @@ -0,0 +1,94 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function train_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new TrainAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->trainAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + train_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php new file mode 100644 index 000000000000..6e7d23c06621 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_AnswerRecords_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php new file mode 100644 index 000000000000..82cd513e4089 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php @@ -0,0 +1,79 @@ +/locations/`. Please see + * {@see AnswerRecordsClient::projectName()} for help formatting this field. + */ +function list_answer_records_sample(string $formattedParent): void +{ + // Create a client. + $answerRecordsClient = new AnswerRecordsClient(); + + // Prepare the request message. + $request = (new ListAnswerRecordsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $answerRecordsClient->listAnswerRecords($request); + + /** @var AnswerRecord $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnswerRecordsClient::projectName('[PROJECT]'); + + list_answer_records_sample($formattedParent); +} +// [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php new file mode 100644 index 000000000000..3fe335ff9226 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_AnswerRecords_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php new file mode 100644 index 000000000000..49088c4752d5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php @@ -0,0 +1,65 @@ +setAnswerFeedback($answerRecordAnswerFeedback); + $updateMask = new FieldMask(); + $request = (new UpdateAnswerRecordRequest()) + ->setAnswerRecord($answerRecord) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var AnswerRecord $response */ + $response = $answerRecordsClient->updateAnswerRecord($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php new file mode 100644 index 000000000000..bfd8e694c3be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php @@ -0,0 +1,99 @@ +/agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * @param string $contextName The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + */ +function create_context_sample(string $formattedParent, string $contextName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $context = (new Context()) + ->setName($contextName); + $request = (new CreateContextRequest()) + ->setParent($formattedParent) + ->setContext($context); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->createContext($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); + $contextName = '[NAME]'; + + create_context_sample($formattedParent, $contextName); +} +// [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php new file mode 100644 index 000000000000..22980cd33805 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php @@ -0,0 +1,74 @@ +/agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + */ +function delete_all_contexts_sample(string $formattedParent): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new DeleteAllContextsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + $contextsClient->deleteAllContexts($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); + + delete_all_contexts_sample($formattedParent); +} +// [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php new file mode 100644 index 000000000000..eef07e251d86 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php @@ -0,0 +1,74 @@ +/agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + */ +function delete_context_sample(string $formattedName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new DeleteContextRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $contextsClient->deleteContext($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ContextsClient::contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + + delete_context_sample($formattedName); +} +// [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php new file mode 100644 index 000000000000..b4c89aeaef73 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php @@ -0,0 +1,76 @@ +/agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + */ +function get_context_sample(string $formattedName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new GetContextRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->getContext($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ContextsClient::contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + + get_context_sample($formattedName); +} +// [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php new file mode 100644 index 000000000000..93582be86f36 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Contexts_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php new file mode 100644 index 000000000000..8ecdaa5c795b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php @@ -0,0 +1,81 @@ +/agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + */ +function list_contexts_sample(string $formattedParent): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new ListContextsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contextsClient->listContexts($request); + + /** @var Context $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); + + list_contexts_sample($formattedParent); +} +// [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php new file mode 100644 index 000000000000..a388c5eee714 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Contexts_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php new file mode 100644 index 000000000000..9af303542e72 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php @@ -0,0 +1,88 @@ +/agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + */ +function update_context_sample(string $contextName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $context = (new Context()) + ->setName($contextName); + $request = (new UpdateContextRequest()) + ->setContext($context); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->updateContext($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $contextName = '[NAME]'; + + update_context_sample($contextName); +} +// [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php new file mode 100644 index 000000000000..dbfaed6b518d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php @@ -0,0 +1,99 @@ +/locations/` + * @param string $conversationDatasetDisplayName The display name of the dataset. Maximum of 64 bytes. + */ +function create_conversation_dataset_sample( + string $parent, + string $conversationDatasetDisplayName +): void { + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $conversationDataset = (new ConversationDataset()) + ->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->createConversationDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationDataset $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $conversationDatasetDisplayName = '[DISPLAY_NAME]'; + + create_conversation_dataset_sample($parent, $conversationDatasetDisplayName); +} +// [END dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php new file mode 100644 index 000000000000..b3712640b9e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php @@ -0,0 +1,95 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + */ +function delete_conversation_dataset_sample(string $formattedName): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $request = (new DeleteConversationDatasetRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->deleteConversationDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + delete_conversation_dataset_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php new file mode 100644 index 000000000000..e82a12cd5d85 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php @@ -0,0 +1,77 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + */ +function get_conversation_dataset_sample(string $formattedName): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $request = (new GetConversationDatasetRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ConversationDataset $response */ + $response = $conversationDatasetsClient->getConversationDataset($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + get_conversation_dataset_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php new file mode 100644 index 000000000000..0b605e75a342 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationDatasets_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php new file mode 100644 index 000000000000..aafcff179f0f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php @@ -0,0 +1,103 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + */ +function import_conversation_data_sample(string $formattedName): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $inputConfig = new InputConfig(); + $request = (new ImportConversationDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->importConversationData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportConversationDataOperationResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + import_conversation_data_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php new file mode 100644 index 000000000000..1ef024a2a480 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php @@ -0,0 +1,78 @@ +/locations/` + * Please see {@see ConversationDatasetsClient::locationName()} for help formatting this field. + */ +function list_conversation_datasets_sample(string $formattedParent): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $request = (new ListConversationDatasetsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationDatasetsClient->listConversationDatasets($request); + + /** @var ConversationDataset $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationDatasetsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_conversation_datasets_sample($formattedParent); +} +// [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php new file mode 100644 index 000000000000..3e8350c9a8a7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationDatasets_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php new file mode 100644 index 000000000000..984df9ab3b5c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php @@ -0,0 +1,112 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationModelsClient::conversationDatasetName()} for help formatting this field. + */ +function create_conversation_model_sample( + string $conversationModelDisplayName, + string $formattedConversationModelDatasetsDataset +): void { + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $inputDataset = (new InputDataset()) + ->setDataset($formattedConversationModelDatasetsDataset); + $conversationModelDatasets = [$inputDataset,]; + $conversationModel = (new ConversationModel()) + ->setDisplayName($conversationModelDisplayName) + ->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->createConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationModel $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationModelDisplayName = '[DISPLAY_NAME]'; + $formattedConversationModelDatasetsDataset = ConversationModelsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + create_conversation_model_sample( + $conversationModelDisplayName, + $formattedConversationModelDatasetsDataset + ); +} +// [END dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php new file mode 100644 index 000000000000..b22f90f75e75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php @@ -0,0 +1,91 @@ +/locations//conversationModels/` + * Please see {@see ConversationModelsClient::conversationModelName()} for help formatting this field. + */ +function create_conversation_model_evaluation_sample(string $formattedParent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $conversationModelEvaluation = new ConversationModelEvaluation(); + $request = (new CreateConversationModelEvaluationRequest()) + ->setParent($formattedParent) + ->setConversationModelEvaluation($conversationModelEvaluation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->createConversationModelEvaluation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationModelEvaluation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationModelsClient::conversationModelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_MODEL]' + ); + + create_conversation_model_evaluation_sample($formattedParent); +} +// [END dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php new file mode 100644 index 000000000000..e764119fcde4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php @@ -0,0 +1,89 @@ +/conversationModels/` + */ +function delete_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new DeleteConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->deleteConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + delete_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php new file mode 100644 index 000000000000..3dbf466df77a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php @@ -0,0 +1,92 @@ +/conversationModels/` + */ +function deploy_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new DeployConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->deployConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + deploy_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php new file mode 100644 index 000000000000..d5ff59a29926 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php @@ -0,0 +1,71 @@ +/conversationModels/` + */ +function get_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new GetConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var ConversationModel $response */ + $response = $conversationModelsClient->getConversationModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + get_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php new file mode 100644 index 000000000000..202a2a4eadca --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php @@ -0,0 +1,72 @@ +/conversationModels//evaluations/` + */ +function get_conversation_model_evaluation_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new GetConversationModelEvaluationRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var ConversationModelEvaluation $response */ + $response = $conversationModelsClient->getConversationModelEvaluation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + get_conversation_model_evaluation_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php new file mode 100644 index 000000000000..7326177f44de --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationModels_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php new file mode 100644 index 000000000000..f549712dfa4d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php @@ -0,0 +1,76 @@ +/conversationModels/` + */ +function list_conversation_model_evaluations_sample(string $parent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new ListConversationModelEvaluationsRequest()) + ->setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationModelsClient->listConversationModelEvaluations($request); + + /** @var ConversationModelEvaluation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_conversation_model_evaluations_sample($parent); +} +// [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php new file mode 100644 index 000000000000..cf7386734f92 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php @@ -0,0 +1,76 @@ +` + */ +function list_conversation_models_sample(string $parent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new ListConversationModelsRequest()) + ->setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationModelsClient->listConversationModels($request); + + /** @var ConversationModel $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_conversation_models_sample($parent); +} +// [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php new file mode 100644 index 000000000000..bd8ead80aac2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationModels_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php new file mode 100644 index 000000000000..09428e93d345 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php @@ -0,0 +1,92 @@ +/conversationModels/` + */ +function undeploy_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new UndeployConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->undeployConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + undeploy_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php new file mode 100644 index 000000000000..5d9bc1c1f7c4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php @@ -0,0 +1,110 @@ +/locations//conversationProfiles/`. + * @param int $participantRole The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @param int $suggestionFeatureType The type of the suggestion feature to remove. + */ +function clear_suggestion_feature_config_sample( + string $conversationProfile, + int $participantRole, + int $suggestionFeatureType +): void { + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new ClearSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationProfilesClient->clearSuggestionFeatureConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationProfile $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationProfile = '[CONVERSATION_PROFILE]'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureType = Type::TYPE_UNSPECIFIED; + + clear_suggestion_feature_config_sample( + $conversationProfile, + $participantRole, + $suggestionFeatureType + ); +} +// [END dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php new file mode 100644 index 000000000000..7dd1476ebd50 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php @@ -0,0 +1,86 @@ +/locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + * @param string $conversationProfileDisplayName Human readable name for this profile. Max length 1024 bytes. + */ +function create_conversation_profile_sample( + string $formattedParent, + string $conversationProfileDisplayName +): void { + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $conversationProfile = (new ConversationProfile()) + ->setDisplayName($conversationProfileDisplayName); + $request = (new CreateConversationProfileRequest()) + ->setParent($formattedParent) + ->setConversationProfile($conversationProfile); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->createConversationProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationProfilesClient::projectName('[PROJECT]'); + $conversationProfileDisplayName = '[DISPLAY_NAME]'; + + create_conversation_profile_sample($formattedParent, $conversationProfileDisplayName); +} +// [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php new file mode 100644 index 000000000000..558390e11521 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php @@ -0,0 +1,74 @@ +/locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + */ +function delete_conversation_profile_sample(string $formattedName): void +{ + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new DeleteConversationProfileRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $conversationProfilesClient->deleteConversationProfile($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationProfilesClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + delete_conversation_profile_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php new file mode 100644 index 000000000000..877b454e5b83 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php @@ -0,0 +1,76 @@ +/locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + */ +function get_conversation_profile_sample(string $formattedName): void +{ + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new GetConversationProfileRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->getConversationProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationProfilesClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + get_conversation_profile_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php new file mode 100644 index 000000000000..8a85ab60f3a9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationProfiles_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php new file mode 100644 index 000000000000..62692dec38e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + */ +function list_conversation_profiles_sample(string $formattedParent): void +{ + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new ListConversationProfilesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationProfilesClient->listConversationProfiles($request); + + /** @var ConversationProfile $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationProfilesClient::projectName('[PROJECT]'); + + list_conversation_profiles_sample($formattedParent); +} +// [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php new file mode 100644 index 000000000000..dc99e878728a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationProfiles_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php new file mode 100644 index 000000000000..b2af213f3920 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php @@ -0,0 +1,111 @@ +/locations//conversationProfiles/`. + * @param int $participantRole The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + */ +function set_suggestion_feature_config_sample( + string $conversationProfile, + int $participantRole +): void { + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $suggestionFeatureConfig = new SuggestionFeatureConfig(); + $request = (new SetSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureConfig($suggestionFeatureConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationProfilesClient->setSuggestionFeatureConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationProfile $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationProfile = '[CONVERSATION_PROFILE]'; + $participantRole = Role::ROLE_UNSPECIFIED; + + set_suggestion_feature_config_sample($conversationProfile, $participantRole); +} +// [END dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php new file mode 100644 index 000000000000..da2e81f83f79 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php @@ -0,0 +1,82 @@ +setDisplayName($conversationProfileDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateConversationProfileRequest()) + ->setConversationProfile($conversationProfile) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->updateConversationProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationProfileDisplayName = '[DISPLAY_NAME]'; + + update_conversation_profile_sample($conversationProfileDisplayName); +} +// [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php new file mode 100644 index 000000000000..c8f6ed688aec --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php @@ -0,0 +1,74 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function complete_conversation_sample(string $formattedName): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->completeConversation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + complete_conversation_sample($formattedName); +} +// [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php new file mode 100644 index 000000000000..bdc98ccf6ed4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php @@ -0,0 +1,106 @@ +/locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * @param string $formattedConversationConversationProfile The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. Please see + * {@see ConversationsClient::conversationProfileName()} for help formatting this field. + */ +function create_conversation_sample( + string $formattedParent, + string $formattedConversationConversationProfile +): void { + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $conversation = (new Conversation()) + ->setConversationProfile($formattedConversationConversationProfile); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->createConversation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::projectName('[PROJECT]'); + $formattedConversationConversationProfile = ConversationsClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + create_conversation_sample($formattedParent, $formattedConversationConversationProfile); +} +// [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php new file mode 100644 index 000000000000..7c4b8dacd4e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php @@ -0,0 +1,73 @@ +/locations/`. Please see + * {@see ConversationsClient::locationName()} for help formatting this field. + */ +function generate_stateless_suggestion_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new GenerateStatelessSuggestionRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var GenerateStatelessSuggestionResponse $response */ + $response = $conversationsClient->generateStatelessSuggestion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::locationName('[PROJECT]', '[LOCATION]'); + + generate_stateless_suggestion_sample($formattedParent); +} +// [END dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php new file mode 100644 index 000000000000..9cc57da0d145 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php @@ -0,0 +1,99 @@ +/locations/`. Please see + * {@see ConversationsClient::locationName()} for help formatting this field. + * @param string $conversationProfileDisplayName Human readable name for this profile. Max length 1024 bytes. + */ +function generate_stateless_summary_sample( + string $statelessConversationMessagesContent, + string $formattedStatelessConversationParent, + string $conversationProfileDisplayName +): void { + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $message = (new Message()) + ->setContent($statelessConversationMessagesContent); + $statelessConversationMessages = [$message,]; + $statelessConversation = (new MinimalConversation()) + ->setMessages($statelessConversationMessages) + ->setParent($formattedStatelessConversationParent); + $conversationProfile = (new ConversationProfile()) + ->setDisplayName($conversationProfileDisplayName); + $request = (new GenerateStatelessSummaryRequest()) + ->setStatelessConversation($statelessConversation) + ->setConversationProfile($conversationProfile); + + // Call the API and handle any network failures. + try { + /** @var GenerateStatelessSummaryResponse $response */ + $response = $conversationsClient->generateStatelessSummary($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $statelessConversationMessagesContent = '[CONTENT]'; + $formattedStatelessConversationParent = ConversationsClient::locationName( + '[PROJECT]', + '[LOCATION]' + ); + $conversationProfileDisplayName = '[DISPLAY_NAME]'; + + generate_stateless_summary_sample( + $statelessConversationMessagesContent, + $formattedStatelessConversationParent, + $conversationProfileDisplayName + ); +} +// [END dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_suggestions.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_suggestions.php new file mode 100644 index 000000000000..bf38215a5303 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_suggestions.php @@ -0,0 +1,78 @@ +/locations//conversations/`. + * + * The conversation must be created with a conversation profile which has + * generators configured in it to be able to get suggestions. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function generate_suggestions_sample(string $formattedConversation): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new GenerateSuggestionsRequest()) + ->setConversation($formattedConversation); + + // Call the API and handle any network failures. + try { + /** @var GenerateSuggestionsResponse $response */ + $response = $conversationsClient->generateSuggestions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedConversation = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + generate_suggestions_sample($formattedConversation); +} +// [END dialogflow_v2_generated_Conversations_GenerateSuggestions_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php new file mode 100644 index 000000000000..c9a501021014 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php @@ -0,0 +1,73 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function get_conversation_sample(string $formattedName): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new GetConversationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->getConversation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + get_conversation_sample($formattedName); +} +// [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php new file mode 100644 index 000000000000..596418e9e479 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Conversations_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/ingest_context_references.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/ingest_context_references.php new file mode 100644 index 000000000000..5784df5dd833 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/ingest_context_references.php @@ -0,0 +1,76 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function ingest_context_references_sample(string $formattedConversation): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $contextReferences = []; + $request = (new IngestContextReferencesRequest()) + ->setConversation($formattedConversation) + ->setContextReferences($contextReferences); + + // Call the API and handle any network failures. + try { + /** @var IngestContextReferencesResponse $response */ + $response = $conversationsClient->ingestContextReferences($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedConversation = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + ingest_context_references_sample($formattedConversation); +} +// [END dialogflow_v2_generated_Conversations_IngestContextReferences_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php new file mode 100644 index 000000000000..98ca75059a5c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + */ +function list_conversations_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new ListConversationsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationsClient->listConversations($request); + + /** @var Conversation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::projectName('[PROJECT]'); + + list_conversations_sample($formattedParent); +} +// [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php new file mode 100644 index 000000000000..8d88ba59047d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Conversations_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php new file mode 100644 index 000000000000..1cc4cab5d103 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php @@ -0,0 +1,82 @@ + + * [first item's create_time of previous request]` and empty page_token. + * + * @param string $formattedParent The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * Please see {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function list_messages_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new ListMessagesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationsClient->listMessages($request); + + /** @var Message $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + list_messages_sample($formattedParent); +} +// [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php new file mode 100644 index 000000000000..cf35e8b3fafb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php @@ -0,0 +1,92 @@ +/locations//conversationProfiles/`. Please see + * {@see ConversationsClient::conversationProfileName()} for help formatting this field. + */ +function search_knowledge_sample( + string $queryText, + string $queryLanguageCode, + string $formattedConversationProfile +): void { + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $query = (new TextInput()) + ->setText($queryText) + ->setLanguageCode($queryLanguageCode); + $request = (new SearchKnowledgeRequest()) + ->setQuery($query) + ->setConversationProfile($formattedConversationProfile); + + // Call the API and handle any network failures. + try { + /** @var SearchKnowledgeResponse $response */ + $response = $conversationsClient->searchKnowledge($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $queryText = '[TEXT]'; + $queryLanguageCode = '[LANGUAGE_CODE]'; + $formattedConversationProfile = ConversationsClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + search_knowledge_sample($queryText, $queryLanguageCode, $formattedConversationProfile); +} +// [END dialogflow_v2_generated_Conversations_SearchKnowledge_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php new file mode 100644 index 000000000000..2099fa68ae3c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php @@ -0,0 +1,75 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function suggest_conversation_summary_sample(string $formattedConversation): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new SuggestConversationSummaryRequest()) + ->setConversation($formattedConversation); + + // Call the API and handle any network failures. + try { + /** @var SuggestConversationSummaryResponse $response */ + $response = $conversationsClient->suggestConversationSummary($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedConversation = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + suggest_conversation_summary_sample($formattedConversation); +} +// [END dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php new file mode 100644 index 000000000000..fac92f2f7171 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php @@ -0,0 +1,116 @@ +/locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * @param string $documentDisplayName The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * @param string $documentMimeType The MIME type of this document. + * @param int $documentKnowledgeTypesElement The knowledge type of document content. + */ +function create_document_sample( + string $formattedParent, + string $documentDisplayName, + string $documentMimeType, + int $documentKnowledgeTypesElement +): void { + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $documentKnowledgeTypes = [$documentKnowledgeTypesElement,]; + $document = (new Document()) + ->setDisplayName($documentDisplayName) + ->setMimeType($documentMimeType) + ->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->createDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentDisplayName = '[DISPLAY_NAME]'; + $documentMimeType = '[MIME_TYPE]'; + $documentKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; + + create_document_sample( + $formattedParent, + $documentDisplayName, + $documentMimeType, + $documentKnowledgeTypesElement + ); +} +// [END dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php new file mode 100644 index 000000000000..ddb603eb9d41 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php @@ -0,0 +1,91 @@ +/locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + */ +function delete_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new DeleteDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->deleteDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + delete_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php new file mode 100644 index 000000000000..9945d3573999 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php @@ -0,0 +1,94 @@ +/locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + */ +function export_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new ExportDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->exportDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + export_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php new file mode 100644 index 000000000000..a44048e5d37e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php @@ -0,0 +1,73 @@ +/locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + */ +function get_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new GetDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $documentsClient->getDocument($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + get_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php new file mode 100644 index 000000000000..781b0af1a7fd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Documents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php new file mode 100644 index 000000000000..372302b00d8d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php @@ -0,0 +1,114 @@ +/locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * @param string $documentTemplateMimeType The MIME type of the document. + * @param int $documentTemplateKnowledgeTypesElement The knowledge type of document content. + */ +function import_documents_sample( + string $formattedParent, + string $documentTemplateMimeType, + int $documentTemplateKnowledgeTypesElement +): void { + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $documentTemplateKnowledgeTypes = [$documentTemplateKnowledgeTypesElement,]; + $documentTemplate = (new ImportDocumentTemplate()) + ->setMimeType($documentTemplateMimeType) + ->setKnowledgeTypes($documentTemplateKnowledgeTypes); + $request = (new ImportDocumentsRequest()) + ->setParent($formattedParent) + ->setDocumentTemplate($documentTemplate); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->importDocuments($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportDocumentsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentTemplateMimeType = '[MIME_TYPE]'; + $documentTemplateKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; + + import_documents_sample( + $formattedParent, + $documentTemplateMimeType, + $documentTemplateKnowledgeTypesElement + ); +} +// [END dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php new file mode 100644 index 000000000000..14e1e876290d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php @@ -0,0 +1,78 @@ +/locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + */ +function list_documents_sample(string $formattedParent): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new ListDocumentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentsClient->listDocuments($request); + + /** @var Document $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + + list_documents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php new file mode 100644 index 000000000000..ba20ee315e9c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Documents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php new file mode 100644 index 000000000000..7668a1eba225 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php @@ -0,0 +1,99 @@ +/locations//knowledgeBases//documents/` + * Please see {@see DocumentsClient::documentName()} for help formatting this field. + */ +function reload_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new ReloadDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->reloadDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + reload_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php new file mode 100644 index 000000000000..01d25f076f76 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php @@ -0,0 +1,104 @@ +setDisplayName($documentDisplayName) + ->setMimeType($documentMimeType) + ->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new UpdateDocumentRequest()) + ->setDocument($document); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->updateDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $documentDisplayName = '[DISPLAY_NAME]'; + $documentMimeType = '[MIME_TYPE]'; + $documentKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; + + update_document_sample($documentDisplayName, $documentMimeType, $documentKnowledgeTypesElement); +} +// [END dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php new file mode 100644 index 000000000000..afd24fe4b107 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EncryptionSpec $response */ + $response = $encryptionSpecServiceClient->getEncryptionSpec($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EncryptionSpecServiceClient::encryptionSpecName('[PROJECT]', '[LOCATION]'); + + get_encryption_spec_sample($formattedName); +} +// [END dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php new file mode 100644 index 000000000000..323bb255fd8a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EncryptionSpecService_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php new file mode 100644 index 000000000000..959049c84629 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php @@ -0,0 +1,93 @@ +setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $encryptionSpecServiceClient->initializeEncryptionSpec($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var InitializeEncryptionSpecResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $encryptionSpecKmsKey = '[KMS_KEY]'; + + initialize_encryption_spec_sample($encryptionSpecKmsKey); +} +// [END dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php new file mode 100644 index 000000000000..f9683a9e9527 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EncryptionSpecService_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php new file mode 100644 index 000000000000..d108a5f05843 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php @@ -0,0 +1,125 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $entitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $entitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function batch_create_entities_sample( + string $formattedParent, + string $entitiesValue, + string $entitiesSynonymsElement +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entitiesSynonyms = [$entitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($entitiesValue) + ->setSynonyms($entitiesSynonyms); + $entities = [$entity,]; + $request = (new BatchCreateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchCreateEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entitiesValue = '[VALUE]'; + $entitiesSynonymsElement = '[SYNONYMS]'; + + batch_create_entities_sample($formattedParent, $entitiesValue, $entitiesSynonymsElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php new file mode 100644 index 000000000000..4b6b26d1a241 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php @@ -0,0 +1,100 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $entityValuesElement The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + */ +function batch_delete_entities_sample(string $formattedParent, string $entityValuesElement): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entityValues = [$entityValuesElement,]; + $request = (new BatchDeleteEntitiesRequest()) + ->setParent($formattedParent) + ->setEntityValues($entityValues); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchDeleteEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entityValuesElement = '[ENTITY_VALUES]'; + + batch_delete_entities_sample($formattedParent, $entityValuesElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php new file mode 100644 index 000000000000..4dfc231fba2a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php @@ -0,0 +1,101 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string $entityTypeNamesElement The names entity types to delete. All names must point to the + * same agent as `parent`. + */ +function batch_delete_entity_types_sample( + string $formattedParent, + string $entityTypeNamesElement +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entityTypeNames = [$entityTypeNamesElement,]; + $request = (new BatchDeleteEntityTypesRequest()) + ->setParent($formattedParent) + ->setEntityTypeNames($entityTypeNames); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchDeleteEntityTypes($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + $entityTypeNamesElement = '[ENTITY_TYPE_NAMES]'; + + batch_delete_entity_types_sample($formattedParent, $entityTypeNamesElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php new file mode 100644 index 000000000000..db379720161d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php @@ -0,0 +1,128 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $entitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $entitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function batch_update_entities_sample( + string $formattedParent, + string $entitiesValue, + string $entitiesSynonymsElement +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entitiesSynonyms = [$entitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($entitiesValue) + ->setSynonyms($entitiesSynonyms); + $entities = [$entity,]; + $request = (new BatchUpdateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchUpdateEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entitiesValue = '[VALUE]'; + $entitiesSynonymsElement = '[SYNONYMS]'; + + batch_update_entities_sample($formattedParent, $entitiesValue, $entitiesSynonymsElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php new file mode 100644 index 000000000000..36ce0d9c9c66 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php @@ -0,0 +1,97 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + */ +function batch_update_entity_types_sample(string $formattedParent): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new BatchUpdateEntityTypesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchUpdateEntityTypes($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchUpdateEntityTypesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + + batch_update_entity_types_sample($formattedParent); +} +// [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php new file mode 100644 index 000000000000..979f1c481d49 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php @@ -0,0 +1,88 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string $entityTypeDisplayName The name of the entity type. + * @param int $entityTypeKind Indicates the kind of entity type. + */ +function create_entity_type_sample( + string $formattedParent, + string $entityTypeDisplayName, + int $entityTypeKind +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entityType = (new EntityType()) + ->setDisplayName($entityTypeDisplayName) + ->setKind($entityTypeKind); + $request = (new CreateEntityTypeRequest()) + ->setParent($formattedParent) + ->setEntityType($entityType); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->createEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + $entityTypeDisplayName = '[DISPLAY_NAME]'; + $entityTypeKind = Kind::KIND_UNSPECIFIED; + + create_entity_type_sample($formattedParent, $entityTypeDisplayName, $entityTypeKind); +} +// [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php new file mode 100644 index 000000000000..5f41331a1fc2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php @@ -0,0 +1,74 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + */ +function delete_entity_type_sample(string $formattedName): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new DeleteEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $entityTypesClient->deleteEntityType($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + + delete_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php new file mode 100644 index 000000000000..2f63677fd6f9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php @@ -0,0 +1,72 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + */ +function get_entity_type_sample(string $formattedName): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new GetEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->getEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + + get_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php new file mode 100644 index 000000000000..e53e23b21ed4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EntityTypes_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php new file mode 100644 index 000000000000..f75b1de26870 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php @@ -0,0 +1,77 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + */ +function list_entity_types_sample(string $formattedParent): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new ListEntityTypesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $entityTypesClient->listEntityTypes($request); + + /** @var EntityType $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + + list_entity_types_sample($formattedParent); +} +// [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php new file mode 100644 index 000000000000..774e8876eac1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EntityTypes_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php new file mode 100644 index 000000000000..e9892190affe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php @@ -0,0 +1,80 @@ +setDisplayName($entityTypeDisplayName) + ->setKind($entityTypeKind); + $request = (new UpdateEntityTypeRequest()) + ->setEntityType($entityType); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->updateEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $entityTypeDisplayName = '[DISPLAY_NAME]'; + $entityTypeKind = Kind::KIND_UNSPECIFIED; + + update_entity_type_sample($entityTypeDisplayName, $entityTypeKind); +} +// [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php new file mode 100644 index 000000000000..f6f6e58ac986 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php @@ -0,0 +1,80 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see EnvironmentsClient::agentName()} for help formatting this field. + * @param string $environmentId The unique id of the new environment. + */ +function create_environment_sample(string $formattedParent, string $environmentId): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $environment = new Environment(); + $request = (new CreateEnvironmentRequest()) + ->setParent($formattedParent) + ->setEnvironment($environment) + ->setEnvironmentId($environmentId); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->createEnvironment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EnvironmentsClient::agentName('[PROJECT]'); + $environmentId = '[ENVIRONMENT_ID]'; + + create_environment_sample($formattedParent, $environmentId); +} +// [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php new file mode 100644 index 000000000000..c8793dd2f25a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php @@ -0,0 +1,76 @@ +/agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. Please see + * {@see EnvironmentsClient::environmentName()} for help formatting this field. + */ +function delete_environment_sample(string $formattedName): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new DeleteEnvironmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $environmentsClient->deleteEnvironment($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); + + delete_environment_sample($formattedName); +} +// [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php new file mode 100644 index 000000000000..c2960bffc80d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php @@ -0,0 +1,78 @@ +/agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. Please see + * {@see EnvironmentsClient::environmentName()} for help formatting this field. + */ +function get_environment_sample(string $formattedName): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new GetEnvironmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->getEnvironment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); + + get_environment_sample($formattedName); +} +// [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php new file mode 100644 index 000000000000..3c3dd8954e3d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php @@ -0,0 +1,83 @@ +/agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. Please see + * {@see EnvironmentsClient::environmentName()} for help formatting this field. + */ +function get_environment_history_sample(string $formattedParent): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new GetEnvironmentHistoryRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $environmentsClient->getEnvironmentHistory($request); + + /** @var Entry $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); + + get_environment_history_sample($formattedParent); +} +// [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php new file mode 100644 index 000000000000..e9f74ee95727 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Environments_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php new file mode 100644 index 000000000000..4467fc31a316 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php @@ -0,0 +1,80 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see EnvironmentsClient::agentName()} for help formatting this field. + */ +function list_environments_sample(string $formattedParent): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new ListEnvironmentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $environmentsClient->listEnvironments($request); + + /** @var Environment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EnvironmentsClient::agentName('[PROJECT]'); + + list_environments_sample($formattedParent); +} +// [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php new file mode 100644 index 000000000000..9b496f3aada0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Environments_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php new file mode 100644 index 000000000000..f88b92e4c967 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php @@ -0,0 +1,73 @@ +setEnvironment($environment) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->updateEnvironment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php new file mode 100644 index 000000000000..b3393ab7a06a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php @@ -0,0 +1,72 @@ +/agent/fulfillment`. Please see + * {@see FulfillmentsClient::fulfillmentName()} for help formatting this field. + */ +function get_fulfillment_sample(string $formattedName): void +{ + // Create a client. + $fulfillmentsClient = new FulfillmentsClient(); + + // Prepare the request message. + $request = (new GetFulfillmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Fulfillment $response */ + $response = $fulfillmentsClient->getFulfillment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FulfillmentsClient::fulfillmentName('[PROJECT]'); + + get_fulfillment_sample($formattedName); +} +// [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php new file mode 100644 index 000000000000..ceb4e32cfefe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Fulfillments_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php new file mode 100644 index 000000000000..68a2018c156a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Fulfillments_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php new file mode 100644 index 000000000000..8700e544dfeb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php @@ -0,0 +1,81 @@ +/agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * + * This field is not used for Fulfillment in an Environment. + */ +function update_fulfillment_sample(string $fulfillmentName): void +{ + // Create a client. + $fulfillmentsClient = new FulfillmentsClient(); + + // Prepare the request message. + $fulfillment = (new Fulfillment()) + ->setName($fulfillmentName); + $updateMask = new FieldMask(); + $request = (new UpdateFulfillmentRequest()) + ->setFulfillment($fulfillment) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Fulfillment $response */ + $response = $fulfillmentsClient->updateFulfillment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $fulfillmentName = '[NAME]'; + + update_fulfillment_sample($fulfillmentName); +} +// [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/create_generator_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/create_generator_evaluation.php new file mode 100644 index 000000000000..743d3892a80c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/create_generator_evaluation.php @@ -0,0 +1,118 @@ +/locations//generators/` + * Please see {@see GeneratorEvaluationsClient::generatorName()} for help formatting this field. + * @param int $generatorEvaluationGeneratorEvaluationConfigInputDataConfigInputDataSourceType The source type of input data. + * @param string $generatorEvaluationGeneratorEvaluationConfigOutputGcsBucketPath The output Cloud Storage bucket path to store eval files, e.g. + * per_summary_accuracy_score report. This path is provided by customer and + * files stored in it are visible to customer, no internal data should be + * stored in this path. + */ +function create_generator_evaluation_sample( + string $formattedParent, + int $generatorEvaluationGeneratorEvaluationConfigInputDataConfigInputDataSourceType, + string $generatorEvaluationGeneratorEvaluationConfigOutputGcsBucketPath +): void { + // Create a client. + $generatorEvaluationsClient = new GeneratorEvaluationsClient(); + + // Prepare the request message. + $generatorEvaluationGeneratorEvaluationConfigInputDataConfig = (new InputDataConfig()) + ->setInputDataSourceType( + $generatorEvaluationGeneratorEvaluationConfigInputDataConfigInputDataSourceType + ); + $generatorEvaluationGeneratorEvaluationConfig = (new GeneratorEvaluationConfig()) + ->setInputDataConfig($generatorEvaluationGeneratorEvaluationConfigInputDataConfig) + ->setOutputGcsBucketPath($generatorEvaluationGeneratorEvaluationConfigOutputGcsBucketPath); + $generatorEvaluationInitialGenerator = new Generator(); + $generatorEvaluation = (new GeneratorEvaluation()) + ->setGeneratorEvaluationConfig($generatorEvaluationGeneratorEvaluationConfig) + ->setInitialGenerator($generatorEvaluationInitialGenerator); + $request = (new CreateGeneratorEvaluationRequest()) + ->setParent($formattedParent) + ->setGeneratorEvaluation($generatorEvaluation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $generatorEvaluationsClient->createGeneratorEvaluation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var GeneratorEvaluation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GeneratorEvaluationsClient::generatorName( + '[PROJECT]', + '[LOCATION]', + '[GENERATOR]' + ); + $generatorEvaluationGeneratorEvaluationConfigInputDataConfigInputDataSourceType = InputDataSourceType::INPUT_DATA_SOURCE_TYPE_UNSPECIFIED; + $generatorEvaluationGeneratorEvaluationConfigOutputGcsBucketPath = '[OUTPUT_GCS_BUCKET_PATH]'; + + create_generator_evaluation_sample( + $formattedParent, + $generatorEvaluationGeneratorEvaluationConfigInputDataConfigInputDataSourceType, + $generatorEvaluationGeneratorEvaluationConfigOutputGcsBucketPath + ); +} +// [END dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/delete_generator_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/delete_generator_evaluation.php new file mode 100644 index 000000000000..9982e2ba30ef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/delete_generator_evaluation.php @@ -0,0 +1,76 @@ +/locations//generators// + * evaluations/` + * Please see {@see GeneratorEvaluationsClient::generatorEvaluationName()} for help formatting this field. + */ +function delete_generator_evaluation_sample(string $formattedName): void +{ + // Create a client. + $generatorEvaluationsClient = new GeneratorEvaluationsClient(); + + // Prepare the request message. + $request = (new DeleteGeneratorEvaluationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $generatorEvaluationsClient->deleteGeneratorEvaluation($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GeneratorEvaluationsClient::generatorEvaluationName( + '[PROJECT]', + '[LOCATION]', + '[GENERATOR]', + '[EVALUATION]' + ); + + delete_generator_evaluation_sample($formattedName); +} +// [END dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_generator_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_generator_evaluation.php new file mode 100644 index 000000000000..a0d8d348a2c0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_generator_evaluation.php @@ -0,0 +1,78 @@ +/locations//generators//evaluations/` + * Please see {@see GeneratorEvaluationsClient::generatorEvaluationName()} for help formatting this field. + */ +function get_generator_evaluation_sample(string $formattedName): void +{ + // Create a client. + $generatorEvaluationsClient = new GeneratorEvaluationsClient(); + + // Prepare the request message. + $request = (new GetGeneratorEvaluationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var GeneratorEvaluation $response */ + $response = $generatorEvaluationsClient->getGeneratorEvaluation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GeneratorEvaluationsClient::generatorEvaluationName( + '[PROJECT]', + '[LOCATION]', + '[GENERATOR]', + '[EVALUATION]' + ); + + get_generator_evaluation_sample($formattedName); +} +// [END dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_location.php new file mode 100644 index 000000000000..a3828bcef86e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_GeneratorEvaluations_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_generator_evaluations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_generator_evaluations.php new file mode 100644 index 000000000000..8cd069def7fd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_generator_evaluations.php @@ -0,0 +1,83 @@ +/locations//generators/` + * Wildcard value `-` is supported on generator_id to list evaluations across + * all generators under same project. Please see + * {@see GeneratorEvaluationsClient::generatorName()} for help formatting this field. + */ +function list_generator_evaluations_sample(string $formattedParent): void +{ + // Create a client. + $generatorEvaluationsClient = new GeneratorEvaluationsClient(); + + // Prepare the request message. + $request = (new ListGeneratorEvaluationsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $generatorEvaluationsClient->listGeneratorEvaluations($request); + + /** @var GeneratorEvaluation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GeneratorEvaluationsClient::generatorName( + '[PROJECT]', + '[LOCATION]', + '[GENERATOR]' + ); + + list_generator_evaluations_sample($formattedParent); +} +// [END dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_locations.php new file mode 100644 index 000000000000..08997a44b6be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorEvaluationsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_GeneratorEvaluations_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php new file mode 100644 index 000000000000..0f4fd8394e24 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php @@ -0,0 +1,74 @@ +/locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + */ +function create_generator_sample(string $formattedParent): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + + // Call the API and handle any network failures. + try { + /** @var Generator $response */ + $response = $generatorsClient->createGenerator($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GeneratorsClient::projectName('[PROJECT]'); + + create_generator_sample($formattedParent); +} +// [END dialogflow_v2_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php new file mode 100644 index 000000000000..098f4a6727cc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php @@ -0,0 +1,70 @@ +/locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + */ +function delete_generator_sample(string $formattedName): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $request = (new DeleteGeneratorRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $generatorsClient->deleteGenerator($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GeneratorsClient::generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + + delete_generator_sample($formattedName); +} +// [END dialogflow_v2_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php new file mode 100644 index 000000000000..569350f4e166 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php @@ -0,0 +1,72 @@ +/locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + */ +function get_generator_sample(string $formattedName): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $request = (new GetGeneratorRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Generator $response */ + $response = $generatorsClient->getGenerator($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GeneratorsClient::generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + + get_generator_sample($formattedName); +} +// [END dialogflow_v2_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php new file mode 100644 index 000000000000..a439ebc26ab5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Generators_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php new file mode 100644 index 000000000000..719afded1d8a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php @@ -0,0 +1,77 @@ +/locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + */ +function list_generators_sample(string $formattedParent): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $request = (new ListGeneratorsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $generatorsClient->listGenerators($request); + + /** @var Generator $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GeneratorsClient::projectName('[PROJECT]'); + + list_generators_sample($formattedParent); +} +// [END dialogflow_v2_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php new file mode 100644 index 000000000000..9eea477dcda0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Generators_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php new file mode 100644 index 000000000000..29dcd6246906 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php @@ -0,0 +1,59 @@ +setGenerator($generator); + + // Call the API and handle any network failures. + try { + /** @var Generator $response */ + $response = $generatorsClient->updateGenerator($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php new file mode 100644 index 000000000000..15497aeceb7d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php @@ -0,0 +1,101 @@ +/agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $intentsDisplayName The name of this intent. + */ +function batch_delete_intents_sample(string $formattedParent, string $intentsDisplayName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $intent = (new Intent()) + ->setDisplayName($intentsDisplayName); + $intents = [$intent,]; + $request = (new BatchDeleteIntentsRequest()) + ->setParent($formattedParent) + ->setIntents($intents); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $intentsClient->batchDeleteIntents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + $intentsDisplayName = '[DISPLAY_NAME]'; + + batch_delete_intents_sample($formattedParent, $intentsDisplayName); +} +// [END dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php new file mode 100644 index 000000000000..0ae6d02b12da --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php @@ -0,0 +1,97 @@ +/agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + */ +function batch_update_intents_sample(string $formattedParent): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new BatchUpdateIntentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $intentsClient->batchUpdateIntents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchUpdateIntentsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + + batch_update_intents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php new file mode 100644 index 000000000000..bf7fd4b7dcbf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php @@ -0,0 +1,81 @@ +/agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $intentDisplayName The name of this intent. + */ +function create_intent_sample(string $formattedParent, string $intentDisplayName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $intent = (new Intent()) + ->setDisplayName($intentDisplayName); + $request = (new CreateIntentRequest()) + ->setParent($formattedParent) + ->setIntent($intent); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->createIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + $intentDisplayName = '[DISPLAY_NAME]'; + + create_intent_sample($formattedParent, $intentDisplayName); +} +// [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php new file mode 100644 index 000000000000..73bbeb4f2a79 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php @@ -0,0 +1,75 @@ +/agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + */ +function delete_intent_sample(string $formattedName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new DeleteIntentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $intentsClient->deleteIntent($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = IntentsClient::intentName('[PROJECT]', '[INTENT]'); + + delete_intent_sample($formattedName); +} +// [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php new file mode 100644 index 000000000000..118bc83f8a76 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php @@ -0,0 +1,72 @@ +/agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + */ +function get_intent_sample(string $formattedName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new GetIntentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->getIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = IntentsClient::intentName('[PROJECT]', '[INTENT]'); + + get_intent_sample($formattedName); +} +// [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php new file mode 100644 index 000000000000..3f7eba69bb42 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Intents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php new file mode 100644 index 000000000000..dd4eaa8586e7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php @@ -0,0 +1,85 @@ +/agent` or `projects//locations//agent`. + * + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + */ +function list_intents_sample(string $formattedParent): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new ListIntentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $intentsClient->listIntents($request); + + /** @var Intent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + + list_intents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php new file mode 100644 index 000000000000..ae7fabdebdba --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Intents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php new file mode 100644 index 000000000000..6c5d08c64a3b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php @@ -0,0 +1,76 @@ +setDisplayName($intentDisplayName); + $request = (new UpdateIntentRequest()) + ->setIntent($intent); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->updateIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $intentDisplayName = '[DISPLAY_NAME]'; + + update_intent_sample($intentDisplayName); +} +// [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php new file mode 100644 index 000000000000..db9ab69fc88c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php @@ -0,0 +1,80 @@ +/locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + * @param string $knowledgeBaseDisplayName The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + */ +function create_knowledge_base_sample( + string $formattedParent, + string $knowledgeBaseDisplayName +): void { + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $knowledgeBase = (new KnowledgeBase()) + ->setDisplayName($knowledgeBaseDisplayName); + $request = (new CreateKnowledgeBaseRequest()) + ->setParent($formattedParent) + ->setKnowledgeBase($knowledgeBase); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->createKnowledgeBase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KnowledgeBasesClient::projectName('[PROJECT]'); + $knowledgeBaseDisplayName = '[DISPLAY_NAME]'; + + create_knowledge_base_sample($formattedParent, $knowledgeBaseDisplayName); +} +// [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php new file mode 100644 index 000000000000..3befb1317f9f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php @@ -0,0 +1,71 @@ +/locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + */ +function delete_knowledge_base_sample(string $formattedName): void +{ + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $request = (new DeleteKnowledgeBaseRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $knowledgeBasesClient->deleteKnowledgeBase($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KnowledgeBasesClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + + delete_knowledge_base_sample($formattedName); +} +// [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php new file mode 100644 index 000000000000..34ab179ba699 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php @@ -0,0 +1,73 @@ +/locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + */ +function get_knowledge_base_sample(string $formattedName): void +{ + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $request = (new GetKnowledgeBaseRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->getKnowledgeBase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KnowledgeBasesClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + + get_knowledge_base_sample($formattedName); +} +// [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php new file mode 100644 index 000000000000..e3b723f9ca81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_KnowledgeBases_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php new file mode 100644 index 000000000000..12a4a8258748 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + */ +function list_knowledge_bases_sample(string $formattedParent): void +{ + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $request = (new ListKnowledgeBasesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $knowledgeBasesClient->listKnowledgeBases($request); + + /** @var KnowledgeBase $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KnowledgeBasesClient::projectName('[PROJECT]'); + + list_knowledge_bases_sample($formattedParent); +} +// [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php new file mode 100644 index 000000000000..2b82b6e34d4f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_KnowledgeBases_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php new file mode 100644 index 000000000000..b94b6fa631dc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php @@ -0,0 +1,73 @@ +setDisplayName($knowledgeBaseDisplayName); + $request = (new UpdateKnowledgeBaseRequest()) + ->setKnowledgeBase($knowledgeBase); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->updateKnowledgeBase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $knowledgeBaseDisplayName = '[DISPLAY_NAME]'; + + update_knowledge_base_sample($knowledgeBaseDisplayName); +} +// [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php new file mode 100644 index 000000000000..f2dbee02e229 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php @@ -0,0 +1,82 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function analyze_content_sample(string $formattedParticipant): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new AnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + + // Call the API and handle any network failures. + try { + /** @var AnalyzeContentResponse $response */ + $response = $participantsClient->analyzeContent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParticipant = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + analyze_content_sample($formattedParticipant); +} +// [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php new file mode 100644 index 000000000000..ebc50049dda6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php @@ -0,0 +1,75 @@ +/locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + */ +function create_participant_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $participant = new Participant(); + $request = (new CreateParticipantRequest()) + ->setParent($formattedParent) + ->setParticipant($participant); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->createParticipant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + create_participant_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php new file mode 100644 index 000000000000..4b1ac4881cf8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Participants_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php new file mode 100644 index 000000000000..65b3e8a78088 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php @@ -0,0 +1,77 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function get_participant_sample(string $formattedName): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new GetParticipantRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->getParticipant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + get_participant_sample($formattedName); +} +// [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php new file mode 100644 index 000000000000..50d9dba902ac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Participants_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php new file mode 100644 index 000000000000..e74ddf493909 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php @@ -0,0 +1,78 @@ +/locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + */ +function list_participants_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new ListParticipantsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $participantsClient->listParticipants($request); + + /** @var Participant $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + list_participants_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php new file mode 100644 index 000000000000..3ddacf3cc35e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php @@ -0,0 +1,97 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function streaming_analyze_content_sample(string $formattedParticipant): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new StreamingAnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $participantsClient->streamingAnalyzeContent(); + $stream->writeAll([$request,]); + + /** @var StreamingAnalyzeContentResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParticipant = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + streaming_analyze_content_sample($formattedParticipant); +} +// [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php new file mode 100644 index 000000000000..8600fe682d05 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php @@ -0,0 +1,78 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_articles_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestArticlesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestArticlesResponse $response */ + $response = $participantsClient->suggestArticles($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_articles_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php new file mode 100644 index 000000000000..db17f3febfdd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php @@ -0,0 +1,78 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_faq_answers_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestFaqAnswersRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestFaqAnswersResponse $response */ + $response = $participantsClient->suggestFaqAnswers($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_faq_answers_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php new file mode 100644 index 000000000000..6561c55bad63 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php @@ -0,0 +1,77 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_knowledge_assist_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestKnowledgeAssistRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestKnowledgeAssistResponse $response */ + $response = $participantsClient->suggestKnowledgeAssist($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_knowledge_assist_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php new file mode 100644 index 000000000000..d1333c39f2aa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php @@ -0,0 +1,78 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_smart_replies_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestSmartRepliesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestSmartRepliesResponse $response */ + $response = $participantsClient->suggestSmartReplies($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_smart_replies_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php new file mode 100644 index 000000000000..51b186172623 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php @@ -0,0 +1,62 @@ +setParticipant($participant) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->updateParticipant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php new file mode 100644 index 000000000000..27fd7219e015 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php @@ -0,0 +1,141 @@ +/agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + * @param string $sessionEntityTypeName The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * @param int $sessionEntityTypeEntityOverrideMode Indicates whether the additional data should override or + * supplement the custom entity type definition. + * @param string $sessionEntityTypeEntitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $sessionEntityTypeEntitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function create_session_entity_type_sample( + string $formattedParent, + string $sessionEntityTypeName, + int $sessionEntityTypeEntityOverrideMode, + string $sessionEntityTypeEntitiesValue, + string $sessionEntityTypeEntitiesSynonymsElement +): void { + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($sessionEntityTypeEntitiesValue) + ->setSynonyms($sessionEntityTypeEntitiesSynonyms); + $sessionEntityTypeEntities = [$entity,]; + $sessionEntityType = (new SessionEntityType()) + ->setName($sessionEntityTypeName) + ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) + ->setEntities($sessionEntityTypeEntities); + $request = (new CreateSessionEntityTypeRequest()) + ->setParent($formattedParent) + ->setSessionEntityType($sessionEntityType); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->createSessionEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SessionEntityTypesClient::sessionName('[PROJECT]', '[SESSION]'); + $sessionEntityTypeName = '[NAME]'; + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityTypeEntitiesValue = '[VALUE]'; + $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]'; + + create_session_entity_type_sample( + $formattedParent, + $sessionEntityTypeName, + $sessionEntityTypeEntityOverrideMode, + $sessionEntityTypeEntitiesValue, + $sessionEntityTypeEntitiesSynonymsElement + ); +} +// [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php new file mode 100644 index 000000000000..3d2c2a2dcfc0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php @@ -0,0 +1,83 @@ +/agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + */ +function delete_session_entity_type_sample(string $formattedName): void +{ + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $request = (new DeleteSessionEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $sessionEntityTypesClient->deleteSessionEntityType($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SessionEntityTypesClient::sessionEntityTypeName( + '[PROJECT]', + '[SESSION]', + '[ENTITY_TYPE]' + ); + + delete_session_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php new file mode 100644 index 000000000000..85fa2138d004 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_SessionEntityTypes_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php new file mode 100644 index 000000000000..b5e1ec44e172 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php @@ -0,0 +1,85 @@ +/agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + */ +function get_session_entity_type_sample(string $formattedName): void +{ + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $request = (new GetSessionEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->getSessionEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SessionEntityTypesClient::sessionEntityTypeName( + '[PROJECT]', + '[SESSION]', + '[ENTITY_TYPE]' + ); + + get_session_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php new file mode 100644 index 000000000000..89d44edd142a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_SessionEntityTypes_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php new file mode 100644 index 000000000000..ff2bc63b37ae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php @@ -0,0 +1,85 @@ +/agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + */ +function list_session_entity_types_sample(string $formattedParent): void +{ + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $request = (new ListSessionEntityTypesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sessionEntityTypesClient->listSessionEntityTypes($request); + + /** @var SessionEntityType $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SessionEntityTypesClient::sessionName('[PROJECT]', '[SESSION]'); + + list_session_entity_types_sample($formattedParent); +} +// [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php new file mode 100644 index 000000000000..70ecb2e3b1d2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php @@ -0,0 +1,127 @@ +/agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * @param int $sessionEntityTypeEntityOverrideMode Indicates whether the additional data should override or + * supplement the custom entity type definition. + * @param string $sessionEntityTypeEntitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $sessionEntityTypeEntitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function update_session_entity_type_sample( + string $sessionEntityTypeName, + int $sessionEntityTypeEntityOverrideMode, + string $sessionEntityTypeEntitiesValue, + string $sessionEntityTypeEntitiesSynonymsElement +): void { + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($sessionEntityTypeEntitiesValue) + ->setSynonyms($sessionEntityTypeEntitiesSynonyms); + $sessionEntityTypeEntities = [$entity,]; + $sessionEntityType = (new SessionEntityType()) + ->setName($sessionEntityTypeName) + ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) + ->setEntities($sessionEntityTypeEntities); + $request = (new UpdateSessionEntityTypeRequest()) + ->setSessionEntityType($sessionEntityType); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->updateSessionEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $sessionEntityTypeName = '[NAME]'; + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityTypeEntitiesValue = '[VALUE]'; + $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]'; + + update_session_entity_type_sample( + $sessionEntityTypeName, + $sessionEntityTypeEntityOverrideMode, + $sessionEntityTypeEntitiesValue, + $sessionEntityTypeEntitiesSynonymsElement + ); +} +// [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php new file mode 100644 index 000000000000..0197e0f80592 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php @@ -0,0 +1,104 @@ +/agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). Please see + * {@see SessionsClient::sessionName()} for help formatting this field. + */ +function detect_intent_sample(string $formattedSession): void +{ + // Create a client. + $sessionsClient = new SessionsClient(); + + // Prepare the request message. + $queryInput = new QueryInput(); + $request = (new DetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + + // Call the API and handle any network failures. + try { + /** @var DetectIntentResponse $response */ + $response = $sessionsClient->detectIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSession = SessionsClient::sessionName('[PROJECT]', '[SESSION]'); + + detect_intent_sample($formattedSession); +} +// [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php new file mode 100644 index 000000000000..8fbf01406bf7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Sessions_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php new file mode 100644 index 000000000000..72f471fb5488 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Sessions_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php new file mode 100644 index 000000000000..94adff609a04 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php @@ -0,0 +1,109 @@ +/agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). Please see + * {@see SessionsClient::sessionName()} for help formatting this field. + */ +function streaming_detect_intent_sample(string $formattedSession): void +{ + // Create a client. + $sessionsClient = new SessionsClient(); + + // Prepare the request message. + $queryInput = new QueryInput(); + $request = (new StreamingDetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $sessionsClient->streamingDetectIntent(); + $stream->writeAll([$request,]); + + /** @var StreamingDetectIntentResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSession = SessionsClient::sessionName('[PROJECT]', '[SESSION]'); + + streaming_detect_intent_sample($formattedSession); +} +// [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/create_sip_trunk.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/create_sip_trunk.php new file mode 100644 index 000000000000..add0d4727e09 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/create_sip_trunk.php @@ -0,0 +1,81 @@ +/locations/`. Please see + * {@see SipTrunksClient::locationName()} for help formatting this field. + * @param string $sipTrunkExpectedHostnameElement The expected hostnames in the peer certificate from partner that + * is used for TLS authentication. + */ +function create_sip_trunk_sample( + string $formattedParent, + string $sipTrunkExpectedHostnameElement +): void { + // Create a client. + $sipTrunksClient = new SipTrunksClient(); + + // Prepare the request message. + $sipTrunkExpectedHostname = [$sipTrunkExpectedHostnameElement,]; + $sipTrunk = (new SipTrunk()) + ->setExpectedHostname($sipTrunkExpectedHostname); + $request = (new CreateSipTrunkRequest()) + ->setParent($formattedParent) + ->setSipTrunk($sipTrunk); + + // Call the API and handle any network failures. + try { + /** @var SipTrunk $response */ + $response = $sipTrunksClient->createSipTrunk($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SipTrunksClient::locationName('[PROJECT]', '[LOCATION]'); + $sipTrunkExpectedHostnameElement = '[EXPECTED_HOSTNAME]'; + + create_sip_trunk_sample($formattedParent, $sipTrunkExpectedHostnameElement); +} +// [END dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/delete_sip_trunk.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/delete_sip_trunk.php new file mode 100644 index 000000000000..66f4398c9ea1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/delete_sip_trunk.php @@ -0,0 +1,71 @@ +/locations//sipTrunks/`. Please see + * {@see SipTrunksClient::sipTrunkName()} for help formatting this field. + */ +function delete_sip_trunk_sample(string $formattedName): void +{ + // Create a client. + $sipTrunksClient = new SipTrunksClient(); + + // Prepare the request message. + $request = (new DeleteSipTrunkRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $sipTrunksClient->deleteSipTrunk($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SipTrunksClient::sipTrunkName('[PROJECT]', '[LOCATION]', '[SIPTRUNK]'); + + delete_sip_trunk_sample($formattedName); +} +// [END dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_location.php new file mode 100644 index 000000000000..73f4b89d6900 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_SipTrunks_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_sip_trunk.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_sip_trunk.php new file mode 100644 index 000000000000..81bcbf3b4f50 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/get_sip_trunk.php @@ -0,0 +1,73 @@ +/locations//sipTrunks/`. Please see + * {@see SipTrunksClient::sipTrunkName()} for help formatting this field. + */ +function get_sip_trunk_sample(string $formattedName): void +{ + // Create a client. + $sipTrunksClient = new SipTrunksClient(); + + // Prepare the request message. + $request = (new GetSipTrunkRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SipTrunk $response */ + $response = $sipTrunksClient->getSipTrunk($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SipTrunksClient::sipTrunkName('[PROJECT]', '[LOCATION]', '[SIPTRUNK]'); + + get_sip_trunk_sample($formattedName); +} +// [END dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_locations.php new file mode 100644 index 000000000000..0a0a063fc3c3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_SipTrunks_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_sip_trunks.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_sip_trunks.php new file mode 100644 index 000000000000..cf8b9abeb13c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/list_sip_trunks.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see SipTrunksClient::locationName()} for help formatting this field. + */ +function list_sip_trunks_sample(string $formattedParent): void +{ + // Create a client. + $sipTrunksClient = new SipTrunksClient(); + + // Prepare the request message. + $request = (new ListSipTrunksRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sipTrunksClient->listSipTrunks($request); + + /** @var SipTrunk $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SipTrunksClient::locationName('[PROJECT]', '[LOCATION]'); + + list_sip_trunks_sample($formattedParent); +} +// [END dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/update_sip_trunk.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/update_sip_trunk.php new file mode 100644 index 000000000000..eaf70c6e229d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SipTrunksClient/update_sip_trunk.php @@ -0,0 +1,74 @@ +setExpectedHostname($sipTrunkExpectedHostname); + $request = (new UpdateSipTrunkRequest()) + ->setSipTrunk($sipTrunk); + + // Call the API and handle any network failures. + try { + /** @var SipTrunk $response */ + $response = $sipTrunksClient->updateSipTrunk($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $sipTrunkExpectedHostnameElement = '[EXPECTED_HOSTNAME]'; + + update_sip_trunk_sample($sipTrunkExpectedHostnameElement); +} +// [END dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/create_tool.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/create_tool.php new file mode 100644 index 000000000000..632562ec576d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/create_tool.php @@ -0,0 +1,79 @@ +/locations/` + * Please see {@see ToolsClient::locationName()} for help formatting this field. + * @param string $toolToolKey A human readable short name of the tool, which should be unique + * within the project. It should only contain letters, numbers, and + * underscores, and it will be used by LLM to identify the tool. + */ +function create_tool_sample(string $formattedParent, string $toolToolKey): void +{ + // Create a client. + $toolsClient = new ToolsClient(); + + // Prepare the request message. + $tool = (new Tool()) + ->setToolKey($toolToolKey); + $request = (new CreateToolRequest()) + ->setParent($formattedParent) + ->setTool($tool); + + // Call the API and handle any network failures. + try { + /** @var Tool $response */ + $response = $toolsClient->createTool($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ToolsClient::locationName('[PROJECT]', '[LOCATION]'); + $toolToolKey = '[TOOL_KEY]'; + + create_tool_sample($formattedParent, $toolToolKey); +} +// [END dialogflow_v2_generated_Tools_CreateTool_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/delete_tool.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/delete_tool.php new file mode 100644 index 000000000000..a7e4e733cba1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/delete_tool.php @@ -0,0 +1,70 @@ +/locations//tools/` + * Please see {@see ToolsClient::toolName()} for help formatting this field. + */ +function delete_tool_sample(string $formattedName): void +{ + // Create a client. + $toolsClient = new ToolsClient(); + + // Prepare the request message. + $request = (new DeleteToolRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $toolsClient->deleteTool($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ToolsClient::toolName('[PROJECT]', '[LOCATION]', '[TOOL]'); + + delete_tool_sample($formattedName); +} +// [END dialogflow_v2_generated_Tools_DeleteTool_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_location.php new file mode 100644 index 000000000000..745e4b9e04db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Tools_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_tool.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_tool.php new file mode 100644 index 000000000000..107c9b07fa91 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/get_tool.php @@ -0,0 +1,72 @@ +/locations//tools/` + * Please see {@see ToolsClient::toolName()} for help formatting this field. + */ +function get_tool_sample(string $formattedName): void +{ + // Create a client. + $toolsClient = new ToolsClient(); + + // Prepare the request message. + $request = (new GetToolRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Tool $response */ + $response = $toolsClient->getTool($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ToolsClient::toolName('[PROJECT]', '[LOCATION]', '[TOOL]'); + + get_tool_sample($formattedName); +} +// [END dialogflow_v2_generated_Tools_GetTool_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_locations.php new file mode 100644 index 000000000000..2bb067528838 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Tools_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_tools.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_tools.php new file mode 100644 index 000000000000..597d51978c30 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/list_tools.php @@ -0,0 +1,77 @@ +/locations/` + * Please see {@see ToolsClient::locationName()} for help formatting this field. + */ +function list_tools_sample(string $formattedParent): void +{ + // Create a client. + $toolsClient = new ToolsClient(); + + // Prepare the request message. + $request = (new ListToolsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $toolsClient->listTools($request); + + /** @var Tool $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ToolsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_tools_sample($formattedParent); +} +// [END dialogflow_v2_generated_Tools_ListTools_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/update_tool.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/update_tool.php new file mode 100644 index 000000000000..d1f6b18db3ed --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ToolsClient/update_tool.php @@ -0,0 +1,74 @@ +setToolKey($toolToolKey); + $request = (new UpdateToolRequest()) + ->setTool($tool); + + // Call the API and handle any network failures. + try { + /** @var Tool $response */ + $response = $toolsClient->updateTool($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $toolToolKey = '[TOOL_KEY]'; + + update_tool_sample($toolToolKey); +} +// [END dialogflow_v2_generated_Tools_UpdateTool_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php new file mode 100644 index 000000000000..4a3085c4cc56 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php @@ -0,0 +1,79 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + */ +function create_version_sample(string $formattedParent): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $version = new Version(); + $request = (new CreateVersionRequest()) + ->setParent($formattedParent) + ->setVersion($version); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->createVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = VersionsClient::agentName('[PROJECT]'); + + create_version_sample($formattedParent); +} +// [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php new file mode 100644 index 000000000000..6607faf27e79 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php @@ -0,0 +1,74 @@ +/agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + */ +function delete_version_sample(string $formattedName): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $request = (new DeleteVersionRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $versionsClient->deleteVersion($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = VersionsClient::versionName('[PROJECT]', '[VERSION]'); + + delete_version_sample($formattedName); +} +// [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php new file mode 100644 index 000000000000..4fa222d8fe61 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Versions_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php new file mode 100644 index 000000000000..4a53d776ff83 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php @@ -0,0 +1,76 @@ +/agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + */ +function get_version_sample(string $formattedName): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $request = (new GetVersionRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->getVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = VersionsClient::versionName('[PROJECT]', '[VERSION]'); + + get_version_sample($formattedName); +} +// [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php new file mode 100644 index 000000000000..991e961f4aa3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Versions_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php new file mode 100644 index 000000000000..52765d446d16 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php @@ -0,0 +1,80 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + */ +function list_versions_sample(string $formattedParent): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $request = (new ListVersionsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $versionsClient->listVersions($request); + + /** @var Version $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = VersionsClient::agentName('[PROJECT]'); + + list_versions_sample($formattedParent); +} +// [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php new file mode 100644 index 000000000000..93a328e420fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php @@ -0,0 +1,66 @@ +setVersion($version) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->updateVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/AgentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AgentsClient.php new file mode 100644 index 000000000000..51732e223064 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AgentsClient.php @@ -0,0 +1,755 @@ + deleteAgentAsync(DeleteAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportAgentAsync(ExportAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAgentAsync(GetAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getValidationResultAsync(GetValidationResultRequest $request, array $optionalArgs = []) + * @method PromiseInterface importAgentAsync(ImportAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface restoreAgentAsync(RestoreAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchAgentsAsync(SearchAgentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setAgentAsync(SetAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface trainAgentAsync(TrainAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class AgentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Agents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/agents_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/agents_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/agents_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/agents_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\AgentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new AgentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified agent. + * + * The async variant is {@see AgentsClient::deleteAgentAsync()} . + * + * @example samples/V2/AgentsClient/delete_agent.php + * + * @param DeleteAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAgent(DeleteAgentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAgent', $request, $callOptions)->wait(); + } + + /** + * Exports the specified agent to a ZIP file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] + * + * The async variant is {@see AgentsClient::exportAgentAsync()} . + * + * @example samples/V2/AgentsClient/export_agent.php + * + * @param ExportAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportAgent(ExportAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportAgent', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent. + * + * The async variant is {@see AgentsClient::getAgentAsync()} . + * + * @example samples/V2/AgentsClient/get_agent.php + * + * @param GetAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Agent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAgent(GetAgentRequest $request, array $callOptions = []): Agent + { + return $this->startApiCall('GetAgent', $request, $callOptions)->wait(); + } + + /** + * Gets agent validation result. Agent validation is performed during + * training time and is updated automatically when training is completed. + * + * The async variant is {@see AgentsClient::getValidationResultAsync()} . + * + * @example samples/V2/AgentsClient/get_validation_result.php + * + * @param GetValidationResultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ValidationResult + * + * @throws ApiException Thrown if the API call fails. + */ + public function getValidationResult(GetValidationResultRequest $request, array $callOptions = []): ValidationResult + { + return $this->startApiCall('GetValidationResult', $request, $callOptions)->wait(); + } + + /** + * Imports the specified agent from a ZIP file. + * + * Uploads new intents and entity types without deleting the existing ones. + * Intents and entity types with the same name are replaced with the new + * versions from + * [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After + * the import, the imported draft agent will be trained automatically (unless + * disabled in agent settings). However, once the import is done, training may + * not be completed yet. Please call + * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + * operation it returns in order to train explicitly. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The operation only tracks when importing is complete, not when it is done + * training. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::importAgentAsync()} . + * + * @example samples/V2/AgentsClient/import_agent.php + * + * @param ImportAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importAgent(ImportAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportAgent', $request, $callOptions)->wait(); + } + + /** + * Restores the specified agent from a ZIP file. + * + * Replaces the current agent version with a new one. All the intents and + * entity types in the older version are deleted. After the restore, the + * restored draft agent will be trained automatically (unless disabled in + * agent settings). However, once the restore is done, training may not be + * completed yet. Please call + * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + * operation it returns in order to train explicitly. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The operation only tracks when restoring is complete, not when it is done + * training. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::restoreAgentAsync()} . + * + * @example samples/V2/AgentsClient/restore_agent.php + * + * @param RestoreAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreAgent(RestoreAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreAgent', $request, $callOptions)->wait(); + } + + /** + * Returns the list of agents. + * + * Since there is at most one conversational agent per project, this method is + * useful primarily for listing all agents across projects the caller has + * access to. One can achieve that with a wildcard project collection id "-". + * Refer to [List + * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * + * The async variant is {@see AgentsClient::searchAgentsAsync()} . + * + * @example samples/V2/AgentsClient/search_agents.php + * + * @param SearchAgentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchAgents(SearchAgentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAgents', $request, $callOptions); + } + + /** + * Creates/updates the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::setAgentAsync()} . + * + * @example samples/V2/AgentsClient/set_agent.php + * + * @param SetAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Agent + * + * @throws ApiException Thrown if the API call fails. + */ + public function setAgent(SetAgentRequest $request, array $callOptions = []): Agent + { + return $this->startApiCall('SetAgent', $request, $callOptions)->wait(); + } + + /** + * Trains the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::trainAgentAsync()} . + * + * @example samples/V2/AgentsClient/train_agent.php + * + * @param TrainAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function trainAgent(TrainAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TrainAgent', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AgentsClient::getLocationAsync()} . + * + * @example samples/V2/AgentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see AgentsClient::listLocationsAsync()} . + * + * @example samples/V2/AgentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php new file mode 100644 index 000000000000..5d293b806c12 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php @@ -0,0 +1,811 @@ + listAnswerRecordsAsync(ListAnswerRecordsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAnswerRecordAsync(UpdateAnswerRecordRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class AnswerRecordsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.AnswerRecords'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/answer_records_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/answer_records_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/answer_records_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/answer_records_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * answer_record resource. + * + * @param string $project + * @param string $answerRecord + * + * @return string The formatted answer_record resource. + */ + public static function answerRecordName(string $project, string $answerRecord): string + { + return self::getPathTemplate('answerRecord')->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a app + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * + * @return string The formatted app resource. + */ + public static function appName(string $project, string $location, string $app): string + { + return self::getPathTemplate('app')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a intent + * resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted intent resource. + */ + public static function intentName(string $project, string $intent): string + { + return self::getPathTemplate('intent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_answer_record resource. + * + * @param string $project + * @param string $answerRecord + * + * @return string The formatted project_answer_record resource. + */ + public static function projectAnswerRecordName(string $project, string $answerRecord): string + { + return self::getPathTemplate('projectAnswerRecord')->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_intent resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted project_intent resource. + */ + public static function projectIntentName(string $project, string $intent): string + { + return self::getPathTemplate('projectIntent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_answer_record resource. + * + * @param string $project + * @param string $location + * @param string $answerRecord + * + * @return string The formatted project_location_answer_record resource. + */ + public static function projectLocationAnswerRecordName(string $project, string $location, string $answerRecord): string + { + return self::getPathTemplate('projectLocationAnswerRecord')->render([ + 'project' => $project, + 'location' => $location, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_intent resource. + * + * @param string $project + * @param string $location + * @param string $intent + * + * @return string The formatted project_location_intent resource. + */ + public static function projectLocationIntentName(string $project, string $location, string $intent): string + { + return self::getPathTemplate('projectLocationIntent')->render([ + 'project' => $project, + 'location' => $location, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tool + * resource. + * + * @param string $project + * @param string $location + * @param string $tool + * + * @return string The formatted tool resource. + */ + public static function toolName(string $project, string $location, string $tool): string + { + return self::getPathTemplate('tool')->render([ + 'project' => $project, + 'location' => $location, + 'tool' => $tool, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a toolset + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * @param string $toolset + * + * @return string The formatted toolset resource. + */ + public static function toolsetName(string $project, string $location, string $app, string $toolset): string + { + return self::getPathTemplate('toolset')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + 'toolset' => $toolset, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - answerRecord: projects/{project}/answerRecords/{answer_record} + * - app: projects/{project}/locations/{location}/apps/{app} + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - intent: projects/{project}/agent/intents/{intent} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectIntent: projects/{project}/agent/intents/{intent} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * - tool: projects/{project}/locations/{location}/tools/{tool} + * - toolset: projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\AnswerRecordsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new AnswerRecordsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the list of all answer records in the specified project in reverse + * chronological order. + * + * The async variant is {@see AnswerRecordsClient::listAnswerRecordsAsync()} . + * + * @example samples/V2/AnswerRecordsClient/list_answer_records.php + * + * @param ListAnswerRecordsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAnswerRecords(ListAnswerRecordsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAnswerRecords', $request, $callOptions); + } + + /** + * Updates the specified answer record. + * + * The async variant is {@see AnswerRecordsClient::updateAnswerRecordAsync()} . + * + * @example samples/V2/AnswerRecordsClient/update_answer_record.php + * + * @param UpdateAnswerRecordRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnswerRecord + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAnswerRecord(UpdateAnswerRecordRequest $request, array $callOptions = []): AnswerRecord + { + return $this->startApiCall('UpdateAnswerRecord', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AnswerRecordsClient::getLocationAsync()} . + * + * @example samples/V2/AnswerRecordsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see AnswerRecordsClient::listLocationsAsync()} . + * + * @example samples/V2/AnswerRecordsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php new file mode 100644 index 000000000000..2535954883a2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php @@ -0,0 +1,661 @@ + createContextAsync(CreateContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAllContextsAsync(DeleteAllContextsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteContextAsync(DeleteContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface getContextAsync(GetContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface listContextsAsync(ListContextsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateContextAsync(UpdateContextRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ContextsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Contexts'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/contexts_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/contexts_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/contexts_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/contexts_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ContextsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ContextsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a context. + * + * If the specified context already exists, overrides the context. + * + * The async variant is {@see ContextsClient::createContextAsync()} . + * + * @example samples/V2/ContextsClient/create_context.php + * + * @param CreateContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function createContext(CreateContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('CreateContext', $request, $callOptions)->wait(); + } + + /** + * Deletes all active contexts in the specified session. + * + * The async variant is {@see ContextsClient::deleteAllContextsAsync()} . + * + * @example samples/V2/ContextsClient/delete_all_contexts.php + * + * @param DeleteAllContextsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAllContexts(DeleteAllContextsRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAllContexts', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified context. + * + * The async variant is {@see ContextsClient::deleteContextAsync()} . + * + * @example samples/V2/ContextsClient/delete_context.php + * + * @param DeleteContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteContext(DeleteContextRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteContext', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified context. + * + * The async variant is {@see ContextsClient::getContextAsync()} . + * + * @example samples/V2/ContextsClient/get_context.php + * + * @param GetContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function getContext(GetContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('GetContext', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all contexts in the specified session. + * + * The async variant is {@see ContextsClient::listContextsAsync()} . + * + * @example samples/V2/ContextsClient/list_contexts.php + * + * @param ListContextsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listContexts(ListContextsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListContexts', $request, $callOptions); + } + + /** + * Updates the specified context. + * + * The async variant is {@see ContextsClient::updateContextAsync()} . + * + * @example samples/V2/ContextsClient/update_context.php + * + * @param UpdateContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateContext(UpdateContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('UpdateContext', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ContextsClient::getLocationAsync()} . + * + * @example samples/V2/ContextsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ContextsClient::listLocationsAsync()} . + * + * @example samples/V2/ContextsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php new file mode 100644 index 000000000000..df5284f3e084 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php @@ -0,0 +1,555 @@ + createConversationDatasetAsync(CreateConversationDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationDatasetAsync(DeleteConversationDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationDatasetAsync(GetConversationDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface importConversationDataAsync(ImportConversationDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationDatasetsAsync(ListConversationDatasetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationDatasetsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationDatasets'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversation_datasets_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversation_datasets_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversation_datasets_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversation_datasets_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_dataset resource. + * + * @param string $project + * @param string $location + * @param string $conversationDataset + * + * @return string The formatted conversation_dataset resource. + */ + public static function conversationDatasetName(string $project, string $location, string $conversationDataset): string + { + return self::getPathTemplate('conversationDataset')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_dataset' => $conversationDataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - conversationDataset: projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationDatasetsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationDatasetsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new conversation dataset. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + * - `response`: + * [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + * + * The async variant is + * {@see ConversationDatasetsClient::createConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/create_conversation_dataset.php + * + * @param CreateConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationDataset(CreateConversationDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified conversation dataset. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationDatasetsClient::deleteConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php + * + * @param DeleteConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationDataset(DeleteConversationDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified conversation dataset. + * + * The async variant is + * {@see ConversationDatasetsClient::getConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/get_conversation_dataset.php + * + * @param GetConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationDataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationDataset(GetConversationDatasetRequest $request, array $callOptions = []): ConversationDataset + { + return $this->startApiCall('GetConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Import data into the specified conversation dataset. Note that it + * is not allowed to import data to a conversation dataset that + * already has data in it. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + * - `response`: + * [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + * + * The async variant is + * {@see ConversationDatasetsClient::importConversationDataAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/import_conversation_data.php + * + * @param ImportConversationDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importConversationData(ImportConversationDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportConversationData', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversation datasets in the specified + * project and location. + * + * The async variant is + * {@see ConversationDatasetsClient::listConversationDatasetsAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/list_conversation_datasets.php + * + * @param ListConversationDatasetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationDatasets(ListConversationDatasetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationDatasets', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationDatasetsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ConversationDatasetsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php new file mode 100644 index 000000000000..59809f59a1ee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php @@ -0,0 +1,845 @@ + createConversationModelAsync(CreateConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConversationModelEvaluationAsync(CreateConversationModelEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationModelAsync(DeleteConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deployConversationModelAsync(DeployConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationModelAsync(GetConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationModelEvaluationAsync(GetConversationModelEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationModelEvaluationsAsync(ListConversationModelEvaluationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationModelsAsync(ListConversationModelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeployConversationModelAsync(UndeployConversationModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationModelsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationModels'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversation_models_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversation_models_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversation_models_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversation_models_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_dataset resource. + * + * @param string $project + * @param string $location + * @param string $conversationDataset + * + * @return string The formatted conversation_dataset resource. + */ + public static function conversationDatasetName(string $project, string $location, string $conversationDataset): string + { + return self::getPathTemplate('conversationDataset')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_dataset' => $conversationDataset, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted conversation_model resource. + */ + public static function conversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('conversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model_evaluation resource. + * + * @param string $project + * @param string $conversationModel + * @param string $evaluation + * + * @return string The formatted conversation_model_evaluation resource. + */ + public static function conversationModelEvaluationName(string $project, string $conversationModel, string $evaluation): string + { + return self::getPathTemplate('conversationModelEvaluation')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model_evaluation resource. + * + * @param string $project + * @param string $conversationModel + * @param string $evaluation + * + * @return string The formatted project_conversation_model_evaluation resource. + */ + public static function projectConversationModelEvaluationName(string $project, string $conversationModel, string $evaluation): string + { + return self::getPathTemplate('projectConversationModelEvaluation')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model_evaluation resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * @param string $evaluation + * + * @return string The formatted project_location_conversation_model_evaluation resource. + */ + public static function projectLocationConversationModelEvaluationName(string $project, string $location, string $conversationModel, string $evaluation): string + { + return self::getPathTemplate('projectLocationConversationModelEvaluation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - conversationDataset: projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationModelEvaluation: projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectConversationModel: projects/{project}/conversationModels/{conversation_model} + * - projectConversationModelEvaluation: projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationConversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - projectLocationConversationModelEvaluation: projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationModelsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationModelsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a model. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + * - `response`: + * [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + * + * The async variant is + * {@see ConversationModelsClient::createConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/create_conversation_model.php + * + * @param CreateConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationModel(CreateConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationModel', $request, $callOptions)->wait(); + } + + /** + * Creates evaluation of a conversation model. + * + * The async variant is + * {@see ConversationModelsClient::createConversationModelEvaluationAsync()} . + * + * @example samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php + * + * @param CreateConversationModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationModelEvaluation(CreateConversationModelEvaluationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Deletes a model. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::deleteConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/delete_conversation_model.php + * + * @param DeleteConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationModel(DeleteConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConversationModel', $request, $callOptions)->wait(); + } + + /** + * Deploys a model. If a model is already deployed, deploying it + * has no effect. A model can only serve prediction requests after it gets + * deployed. For article suggestion, custom model will not be used unless + * it is deployed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::deployConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/deploy_conversation_model.php + * + * @param DeployConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deployConversationModel(DeployConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeployConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets conversation model. + * + * The async variant is + * {@see ConversationModelsClient::getConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_conversation_model.php + * + * @param GetConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationModel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationModel(GetConversationModelRequest $request, array $callOptions = []): ConversationModel + { + return $this->startApiCall('GetConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets an evaluation of conversation model. + * + * The async variant is + * {@see ConversationModelsClient::getConversationModelEvaluationAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php + * + * @param GetConversationModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationModelEvaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationModelEvaluation(GetConversationModelEvaluationRequest $request, array $callOptions = []): ConversationModelEvaluation + { + return $this->startApiCall('GetConversationModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Lists evaluations of a conversation model. + * + * The async variant is + * {@see ConversationModelsClient::listConversationModelEvaluationsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php + * + * @param ListConversationModelEvaluationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationModelEvaluations(ListConversationModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationModelEvaluations', $request, $callOptions); + } + + /** + * Lists conversation models. + * + * The async variant is + * {@see ConversationModelsClient::listConversationModelsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_conversation_models.php + * + * @param ListConversationModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationModels(ListConversationModelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationModels', $request, $callOptions); + } + + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * If the model is currently being used: + * - For article suggestion, article suggestion will fallback to the default + * model if model is undeployed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::undeployConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/undeploy_conversation_model.php + * + * @param UndeployConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeployConversationModel(UndeployConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeployConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationModelsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ConversationModelsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php new file mode 100644 index 000000000000..c30ace20cb66 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php @@ -0,0 +1,956 @@ + clearSuggestionFeatureConfigAsync(ClearSuggestionFeatureConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConversationProfileAsync(CreateConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationProfileAsync(DeleteConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationProfileAsync(GetConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationProfilesAsync(ListConversationProfilesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSuggestionFeatureConfigAsync(SetSuggestionFeatureConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateConversationProfileAsync(UpdateConversationProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationProfilesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationProfiles'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversation_profiles_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversation_profiles_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversation_profiles_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversation_profiles_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * cx_security_settings resource. + * + * @param string $project + * @param string $location + * @param string $securitySettings + * + * @return string The formatted cx_security_settings resource. + */ + public static function cXSecuritySettingsName(string $project, string $location, string $securitySettings): string + { + return self::getPathTemplate('cXSecuritySettings')->render([ + 'project' => $project, + 'location' => $location, + 'security_settings' => $securitySettings, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted conversation_model resource. + */ + public static function conversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('conversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted conversation_profile resource. + */ + public static function conversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('conversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted project_conversation_profile resource. + */ + public static function projectConversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('projectConversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_profile resource. + * + * @param string $project + * @param string $location + * @param string $conversationProfile + * + * @return string The formatted project_location_conversation_profile resource. + */ + public static function projectLocationConversationProfileName(string $project, string $location, string $conversationProfile): string + { + return self::getPathTemplate('projectLocationConversationProfile')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - cXSecuritySettings: projects/{project}/locations/{location}/securitySettings/{security_settings} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectConversationModel: projects/{project}/conversationModels/{conversation_model} + * - projectConversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationConversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - projectLocationConversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationProfilesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationProfilesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Clears a suggestion feature from a conversation profile for the given + * participant role. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + * - `response`: + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + * + * The async variant is + * {@see ConversationProfilesClient::clearSuggestionFeatureConfigAsync()} . + * + * @example samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php + * + * @param ClearSuggestionFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function clearSuggestionFeatureConfig(ClearSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ClearSuggestionFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Creates a conversation profile in the specified project. + * + * [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] + * and + * [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * The async variant is + * {@see ConversationProfilesClient::createConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/create_conversation_profile.php + * + * @param CreateConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationProfile(CreateConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('CreateConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified conversation profile. + * + * The async variant is + * {@see ConversationProfilesClient::deleteConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/delete_conversation_profile.php + * + * @param DeleteConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationProfile(DeleteConversationProfileRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified conversation profile. + * + * The async variant is + * {@see ConversationProfilesClient::getConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/get_conversation_profile.php + * + * @param GetConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationProfile(GetConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('GetConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversation profiles in the specified project. + * + * The async variant is + * {@see ConversationProfilesClient::listConversationProfilesAsync()} . + * + * @example samples/V2/ConversationProfilesClient/list_conversation_profiles.php + * + * @param ListConversationProfilesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationProfiles(ListConversationProfilesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationProfiles', $request, $callOptions); + } + + /** + * Adds or updates a suggestion feature in a conversation profile. + * If the conversation profile contains the type of suggestion feature for + * the participant role, it will update it. Otherwise it will insert the + * suggestion feature. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + * - `response`: + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + * + * If a long running operation to add or update suggestion feature + * config for the same conversation profile, participant role and suggestion + * feature type exists, please cancel the existing long running operation + * before sending such request, otherwise the request will be rejected. + * + * The async variant is + * {@see ConversationProfilesClient::setSuggestionFeatureConfigAsync()} . + * + * @example samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php + * + * @param SetSuggestionFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSuggestionFeatureConfig(SetSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSuggestionFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Updates the specified conversation profile. + * + * [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] + * and + * [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * The async variant is + * {@see ConversationProfilesClient::updateConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/update_conversation_profile.php + * + * @param UpdateConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConversationProfile(UpdateConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('UpdateConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationProfilesClient::getLocationAsync()} . + * + * @example samples/V2/ConversationProfilesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ConversationProfilesClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationProfilesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php new file mode 100644 index 000000000000..2635fd919637 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php @@ -0,0 +1,1252 @@ + completeConversationAsync(CompleteConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createConversationAsync(CreateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateStatelessSuggestionAsync(GenerateStatelessSuggestionRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateStatelessSummaryAsync(GenerateStatelessSummaryRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateSuggestionsAsync(GenerateSuggestionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationAsync(GetConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface ingestContextReferencesAsync(IngestContextReferencesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationsAsync(ListConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMessagesAsync(ListMessagesRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchKnowledgeAsync(SearchKnowledgeRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestConversationSummaryAsync(SuggestConversationSummaryRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ConversationsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Conversations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/conversations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/conversations_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/conversations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/conversations_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a app + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * + * @return string The formatted app resource. + */ + public static function appName(string $project, string $location, string $app): string + { + return self::getPathTemplate('app')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * cx_security_settings resource. + * + * @param string $project + * @param string $location + * @param string $securitySettings + * + * @return string The formatted cx_security_settings resource. + */ + public static function cXSecuritySettingsName(string $project, string $location, string $securitySettings): string + { + return self::getPathTemplate('cXSecuritySettings')->render([ + 'project' => $project, + 'location' => $location, + 'security_settings' => $securitySettings, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a conversation + * resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted conversation resource. + */ + public static function conversationName(string $project, string $conversation): string + { + return self::getPathTemplate('conversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted conversation_model resource. + */ + public static function conversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('conversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted conversation_profile resource. + */ + public static function conversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('conversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_store + * resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted data_store resource. + */ + public static function dataStoreName(string $project, string $location, string $collection, string $dataStore): string + { + return self::getPathTemplate('dataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('message')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted project_conversation resource. + */ + public static function projectConversationName(string $project, string $conversation): string + { + return self::getPathTemplate('projectConversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_message resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted project_conversation_message resource. + */ + public static function projectConversationMessageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('projectConversationMessage')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted project_conversation_profile resource. + */ + public static function projectConversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('projectConversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * + * @return string The formatted project_location_collection_data_store resource. + */ + public static function projectLocationCollectionDataStoreName(string $project, string $location, string $collection, string $dataStore): string + { + return self::getPathTemplate('projectLocationCollectionDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * + * @return string The formatted project_location_conversation resource. + */ + public static function projectLocationConversationName(string $project, string $location, string $conversation): string + { + return self::getPathTemplate('projectLocationConversation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_message resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $message + * + * @return string The formatted project_location_conversation_message resource. + */ + public static function projectLocationConversationMessageName(string $project, string $location, string $conversation, string $message): string + { + return self::getPathTemplate('projectLocationConversationMessage')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_profile resource. + * + * @param string $project + * @param string $location + * @param string $conversationProfile + * + * @return string The formatted project_location_conversation_profile resource. + */ + public static function projectLocationConversationProfileName(string $project, string $location, string $conversationProfile): string + { + return self::getPathTemplate('projectLocationConversationProfile')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * + * @return string The formatted project_location_data_store resource. + */ + public static function projectLocationDataStoreName(string $project, string $location, string $dataStore): string + { + return self::getPathTemplate('projectLocationDataStore')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tool + * resource. + * + * @param string $project + * @param string $location + * @param string $tool + * + * @return string The formatted tool resource. + */ + public static function toolName(string $project, string $location, string $tool): string + { + return self::getPathTemplate('tool')->render([ + 'project' => $project, + 'location' => $location, + 'tool' => $tool, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a toolset + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * @param string $toolset + * + * @return string The formatted toolset resource. + */ + public static function toolsetName(string $project, string $location, string $app, string $toolset): string + { + return self::getPathTemplate('toolset')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + 'toolset' => $toolset, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - app: projects/{project}/locations/{location}/apps/{app} + * - cXSecuritySettings: projects/{project}/locations/{location}/securitySettings/{security_settings} + * - conversation: projects/{project}/conversations/{conversation} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - dataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectConversation: projects/{project}/conversations/{conversation} + * - projectConversationMessage: projects/{project}/conversations/{conversation}/messages/{message} + * - projectConversationModel: projects/{project}/conversationModels/{conversation_model} + * - projectConversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationCollectionDataStore: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} + * - projectLocationConversation: projects/{project}/locations/{location}/conversations/{conversation} + * - projectLocationConversationMessage: projects/{project}/locations/{location}/conversations/{conversation}/messages/{message} + * - projectLocationConversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - projectLocationConversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile} + * - projectLocationDataStore: projects/{project}/locations/{location}/dataStores/{data_store} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * - tool: projects/{project}/locations/{location}/tools/{tool} + * - toolset: projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ConversationsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ConversationsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * The async variant is {@see ConversationsClient::completeConversationAsync()} . + * + * @example samples/V2/ConversationsClient/complete_conversation.php + * + * @param CompleteConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function completeConversation(CompleteConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CompleteConversation', $request, $callOptions)->wait(); + } + + /** + * Creates a new conversation. Conversations are auto-completed after 24 + * hours. + * + * Conversation Lifecycle: + * There are two stages during a conversation: Automated Agent Stage and + * Assist Stage. + * + * For Automated Agent Stage, there will be a dialogflow agent responding to + * user queries. + * + * For Assist Stage, there's no dialogflow agent responding to user queries. + * But we will provide suggestions which are generated from conversation. + * + * If + * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] + * is configured for a dialogflow agent, conversation will start from + * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And + * during `Automated Agent Stage`, once an + * [Intent][google.cloud.dialogflow.v2.Intent] with + * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] + * is triggered, conversation will transfer to Assist Stage. + * + * The async variant is {@see ConversationsClient::createConversationAsync()} . + * + * @example samples/V2/ConversationsClient/create_conversation.php + * + * @param CreateConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversation(CreateConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); + } + + /** + * Generates and returns a suggestion for a conversation that does not have a + * resource created for it. + * + * The async variant is + * {@see ConversationsClient::generateStatelessSuggestionAsync()} . + * + * @example samples/V2/ConversationsClient/generate_stateless_suggestion.php + * + * @param GenerateStatelessSuggestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateStatelessSuggestionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateStatelessSuggestion(GenerateStatelessSuggestionRequest $request, array $callOptions = []): GenerateStatelessSuggestionResponse + { + return $this->startApiCall('GenerateStatelessSuggestion', $request, $callOptions)->wait(); + } + + /** + * Generates and returns a summary for a conversation that does not have a + * resource created for it. + * + * The async variant is {@see ConversationsClient::generateStatelessSummaryAsync()} + * . + * + * @example samples/V2/ConversationsClient/generate_stateless_summary.php + * + * @param GenerateStatelessSummaryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateStatelessSummaryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateStatelessSummary(GenerateStatelessSummaryRequest $request, array $callOptions = []): GenerateStatelessSummaryResponse + { + return $this->startApiCall('GenerateStatelessSummary', $request, $callOptions)->wait(); + } + + /** + * Generates all the suggestions using generators configured in the + * conversation profile. A generator is used only if its trigger event is + * matched. + * + * The async variant is {@see ConversationsClient::generateSuggestionsAsync()} . + * + * @example samples/V2/ConversationsClient/generate_suggestions.php + * + * @param GenerateSuggestionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateSuggestionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateSuggestions(GenerateSuggestionsRequest $request, array $callOptions = []): GenerateSuggestionsResponse + { + return $this->startApiCall('GenerateSuggestions', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specific conversation. + * + * The async variant is {@see ConversationsClient::getConversationAsync()} . + * + * @example samples/V2/ConversationsClient/get_conversation.php + * + * @param GetConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversation(GetConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); + } + + /** + * Data ingestion API. + * Ingests context references for an existing conversation. + * + * The async variant is {@see ConversationsClient::ingestContextReferencesAsync()} + * . + * + * @example samples/V2/ConversationsClient/ingest_context_references.php + * + * @param IngestContextReferencesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return IngestContextReferencesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function ingestContextReferences(IngestContextReferencesRequest $request, array $callOptions = []): IngestContextReferencesResponse + { + return $this->startApiCall('IngestContextReferences', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversations in the specified project. + * + * The async variant is {@see ConversationsClient::listConversationsAsync()} . + * + * @example samples/V2/ConversationsClient/list_conversations.php + * + * @param ListConversationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversations', $request, $callOptions); + } + + /** + * Lists messages that belong to a given conversation. + * `messages` are ordered by `create_time` in descending order. To fetch + * updates without duplication, send request with filter + * `create_time_epoch_microseconds > + * [first item's create_time of previous request]` and empty page_token. + * + * The async variant is {@see ConversationsClient::listMessagesAsync()} . + * + * @example samples/V2/ConversationsClient/list_messages.php + * + * @param ListMessagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMessages(ListMessagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMessages', $request, $callOptions); + } + + /** + * Get answers for the given query based on knowledge documents. + * + * The async variant is {@see ConversationsClient::searchKnowledgeAsync()} . + * + * @example samples/V2/ConversationsClient/search_knowledge.php + * + * @param SearchKnowledgeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SearchKnowledgeResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchKnowledge(SearchKnowledgeRequest $request, array $callOptions = []): SearchKnowledgeResponse + { + return $this->startApiCall('SearchKnowledge', $request, $callOptions)->wait(); + } + + /** + * Suggests summary for a conversation based on specific historical messages. + * The range of the messages to be used for summary can be specified in the + * request. + * + * The async variant is + * {@see ConversationsClient::suggestConversationSummaryAsync()} . + * + * @example samples/V2/ConversationsClient/suggest_conversation_summary.php + * + * @param SuggestConversationSummaryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestConversationSummaryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestConversationSummary(SuggestConversationSummaryRequest $request, array $callOptions = []): SuggestConversationSummaryResponse + { + return $this->startApiCall('SuggestConversationSummary', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ConversationsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php new file mode 100644 index 000000000000..378f7bc8fa98 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php @@ -0,0 +1,739 @@ + createDocumentAsync(CreateDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDocumentAsync(DeleteDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportDocumentAsync(ExportDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDocumentAsync(GetDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface importDocumentsAsync(ImportDocumentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDocumentsAsync(ListDocumentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface reloadDocumentAsync(ReloadDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDocumentAsync(UpdateDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class DocumentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Documents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/documents_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/documents_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/documents_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/documents_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('document')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectKnowledgeBaseDocument: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBaseDocument: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\DocumentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new DocumentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::createDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/create_document.php + * + * @param CreateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDocument(CreateDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDocument', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is {@see DocumentsClient::deleteDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/delete_document.php + * + * @param DeleteDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDocument(DeleteDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDocument', $request, $callOptions)->wait(); + } + + /** + * Exports a smart messaging candidate document into the specified + * destination. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::exportDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/export_document.php + * + * @param ExportDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportDocument(ExportDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportDocument', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified document. + * + * The async variant is {@see DocumentsClient::getDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/get_document.php + * + * @param GetDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); + } + + /** + * Creates documents by importing data from external sources. + * Dialogflow supports up to 350 documents in each request. If you try to + * import more, Dialogflow will return an error. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: + * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] + * + * The async variant is {@see DocumentsClient::importDocumentsAsync()} . + * + * @example samples/V2/DocumentsClient/import_documents.php + * + * @param ImportDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importDocuments(ImportDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportDocuments', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all documents of the knowledge base. + * + * The async variant is {@see DocumentsClient::listDocumentsAsync()} . + * + * @example samples/V2/DocumentsClient/list_documents.php + * + * @param ListDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDocuments(ListDocumentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDocuments', $request, $callOptions); + } + + /** + * Reloads the specified document from its specified source, content_uri or + * content. The previously loaded content of the document will be deleted. + * Note: Even when the content of the document has not changed, there still + * may be side effects because of internal implementation changes. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * The async variant is {@see DocumentsClient::reloadDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/reload_document.php + * + * @param ReloadDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reloadDocument(ReloadDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ReloadDocument', $request, $callOptions)->wait(); + } + + /** + * Updates the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::updateDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/update_document.php + * + * @param UpdateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDocument(UpdateDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDocument', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DocumentsClient::getLocationAsync()} . + * + * @example samples/V2/DocumentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see DocumentsClient::listLocationsAsync()} . + * + * @example samples/V2/DocumentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php new file mode 100644 index 000000000000..fcfe2dde933c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php @@ -0,0 +1,416 @@ + getEncryptionSpecAsync(GetEncryptionSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface initializeEncryptionSpecAsync(InitializeEncryptionSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class EncryptionSpecServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.EncryptionSpecService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/encryption_spec_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/encryption_spec_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/encryption_spec_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/encryption_spec_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * encryption_spec resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted encryption_spec resource. + */ + public static function encryptionSpecName(string $project, string $location): string + { + return self::getPathTemplate('encryptionSpec')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\EncryptionSpecServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EncryptionSpecServiceClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets location-level encryption key specification. + * + * The async variant is + * {@see EncryptionSpecServiceClient::getEncryptionSpecAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php + * + * @param GetEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EncryptionSpec + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $callOptions = []): EncryptionSpec + { + return $this->startApiCall('GetEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * Initializes a location-level encryption key specification. An error will + * be thrown if the location has resources already created before the + * initialization. Once the encryption specification is initialized at a + * location, it is immutable and all newly created resources under the + * location will be encrypted with the existing specification. + * + * The async variant is + * {@see EncryptionSpecServiceClient::initializeEncryptionSpecAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php + * + * @param InitializeEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function initializeEncryptionSpec(InitializeEncryptionSpecRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EncryptionSpecServiceClient::getLocationAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see EncryptionSpecServiceClient::listLocationsAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php new file mode 100644 index 000000000000..6c3d25ba2e33 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php @@ -0,0 +1,802 @@ + batchCreateEntitiesAsync(BatchCreateEntitiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface createEntityTypeAsync(CreateEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteEntityTypeAsync(DeleteEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEntityTypeAsync(GetEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listEntityTypesAsync(ListEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateEntityTypeAsync(UpdateEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class EntityTypesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.EntityTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/entity_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/entity_types_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/entity_types_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/entity_types_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a entity_type + * resource. + * + * @param string $project + * @param string $entityType + * + * @return string The formatted entity_type resource. + */ + public static function entityTypeName(string $project, string $entityType): string + { + return self::getPathTemplate('entityType')->render([ + 'project' => $project, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_entity_type resource. + * + * @param string $project + * @param string $entityType + * + * @return string The formatted project_entity_type resource. + */ + public static function projectEntityTypeName(string $project, string $entityType): string + { + return self::getPathTemplate('projectEntityType')->render([ + 'project' => $project, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $entityType + * + * @return string The formatted project_location_entity_type resource. + */ + public static function projectLocationEntityTypeName(string $project, string $location, string $entityType): string + { + return self::getPathTemplate('projectLocationEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - entityType: projects/{project}/agent/entityTypes/{entity_type} + * - projectAgent: projects/{project}/agent + * - projectEntityType: projects/{project}/agent/entityTypes/{entity_type} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationEntityType: projects/{project}/locations/{location}/agent/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\EntityTypesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EntityTypesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates multiple new entities in the specified entity type. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchCreateEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_create_entities.php + * + * @param BatchCreateEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchCreateEntities(BatchCreateEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchCreateEntities', $request, $callOptions)->wait(); + } + + /** + * Deletes entities in the specified entity type. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchDeleteEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_delete_entities.php + * + * @param BatchDeleteEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteEntities(BatchDeleteEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteEntities', $request, $callOptions)->wait(); + } + + /** + * Deletes entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchDeleteEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_delete_entity_types.php + * + * @param BatchDeleteEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteEntityTypes(BatchDeleteEntityTypesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteEntityTypes', $request, $callOptions)->wait(); + } + + /** + * Updates or creates multiple entities in the specified entity type. This + * method does not affect entities in the entity type that aren't explicitly + * specified in the request. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * + * The async variant is {@see EntityTypesClient::batchUpdateEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_update_entities.php + * + * @param BatchUpdateEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntities(BatchUpdateEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateEntities', $request, $callOptions)->wait(); + } + + /** + * Updates/Creates multiple entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse] + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchUpdateEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_update_entity_types.php + * + * @param BatchUpdateEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntityTypes(BatchUpdateEntityTypesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateEntityTypes', $request, $callOptions)->wait(); + } + + /** + * Creates an entity type in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::createEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/create_entity_type.php + * + * @param CreateEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEntityType(CreateEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('CreateEntityType', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::deleteEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/delete_entity_type.php + * + * @param DeleteEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEntityType(DeleteEntityTypeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEntityType', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified entity type. + * + * The async variant is {@see EntityTypesClient::getEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/get_entity_type.php + * + * @param GetEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEntityType(GetEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('GetEntityType', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all entity types in the specified agent. + * + * The async variant is {@see EntityTypesClient::listEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/list_entity_types.php + * + * @param ListEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEntityTypes(ListEntityTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEntityTypes', $request, $callOptions); + } + + /** + * Updates the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::updateEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/update_entity_type.php + * + * @param UpdateEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEntityType(UpdateEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('UpdateEntityType', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EntityTypesClient::getLocationAsync()} . + * + * @example samples/V2/EntityTypesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see EntityTypesClient::listLocationsAsync()} . + * + * @example samples/V2/EntityTypesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php new file mode 100644 index 000000000000..3399db68411a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php @@ -0,0 +1,670 @@ + createEnvironmentAsync(CreateEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteEnvironmentAsync(DeleteEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEnvironmentAsync(GetEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEnvironmentHistoryAsync(GetEnvironmentHistoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface listEnvironmentsAsync(ListEnvironmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateEnvironmentAsync(UpdateEnvironmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class EnvironmentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Environments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/environments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/environments_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/environments_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/environments_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a environment + * resource. + * + * @param string $project + * @param string $environment + * + * @return string The formatted environment resource. + */ + public static function environmentName(string $project, string $environment): string + { + return self::getPathTemplate('environment')->render([ + 'project' => $project, + 'environment' => $environment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a fulfillment + * resource. + * + * @param string $project + * + * @return string The formatted fulfillment resource. + */ + public static function fulfillmentName(string $project): string + { + return self::getPathTemplate('fulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment resource. + * + * @param string $project + * @param string $environment + * + * @return string The formatted project_environment resource. + */ + public static function projectEnvironmentName(string $project, string $environment): string + { + return self::getPathTemplate('projectEnvironment')->render([ + 'project' => $project, + 'environment' => $environment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_fulfillment resource. + * + * @param string $project + * + * @return string The formatted project_fulfillment resource. + */ + public static function projectFulfillmentName(string $project): string + { + return self::getPathTemplate('projectFulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment resource. + * + * @param string $project + * @param string $location + * @param string $environment + * + * @return string The formatted project_location_environment resource. + */ + public static function projectLocationEnvironmentName(string $project, string $location, string $environment): string + { + return self::getPathTemplate('projectLocationEnvironment')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_fulfillment resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_fulfillment resource. + */ + public static function projectLocationFulfillmentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationFulfillment')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_version resource. + * + * @param string $project + * @param string $location + * @param string $version + * + * @return string The formatted project_location_version resource. + */ + public static function projectLocationVersionName(string $project, string $location, string $version): string + { + return self::getPathTemplate('projectLocationVersion')->render([ + 'project' => $project, + 'location' => $location, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_version resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted project_version resource. + */ + public static function projectVersionName(string $project, string $version): string + { + return self::getPathTemplate('projectVersion')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a version + * resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted version resource. + */ + public static function versionName(string $project, string $version): string + { + return self::getPathTemplate('version')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - environment: projects/{project}/agent/environments/{environment} + * - fulfillment: projects/{project}/agent/fulfillment + * - projectAgent: projects/{project}/agent + * - projectEnvironment: projects/{project}/agent/environments/{environment} + * - projectFulfillment: projects/{project}/agent/fulfillment + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationEnvironment: projects/{project}/locations/{location}/agent/environments/{environment} + * - projectLocationFulfillment: projects/{project}/locations/{location}/agent/fulfillment + * - projectLocationVersion: projects/{project}/locations/{location}/agent/versions/{version} + * - projectVersion: projects/{project}/agent/versions/{version} + * - version: projects/{project}/agent/versions/{version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\EnvironmentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new EnvironmentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an agent environment. + * + * The async variant is {@see EnvironmentsClient::createEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/create_environment.php + * + * @param CreateEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEnvironment(CreateEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('CreateEnvironment', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified agent environment. + * + * The async variant is {@see EnvironmentsClient::deleteEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/delete_environment.php + * + * @param DeleteEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEnvironment(DeleteEnvironmentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEnvironment', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent environment. + * + * The async variant is {@see EnvironmentsClient::getEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_environment.php + * + * @param GetEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEnvironment(GetEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('GetEnvironment', $request, $callOptions)->wait(); + } + + /** + * Gets the history of the specified environment. + * + * The async variant is {@see EnvironmentsClient::getEnvironmentHistoryAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_environment_history.php + * + * @param GetEnvironmentHistoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEnvironmentHistory(GetEnvironmentHistoryRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('GetEnvironmentHistory', $request, $callOptions); + } + + /** + * Returns the list of all non-default environments of the specified agent. + * + * The async variant is {@see EnvironmentsClient::listEnvironmentsAsync()} . + * + * @example samples/V2/EnvironmentsClient/list_environments.php + * + * @param ListEnvironmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEnvironments(ListEnvironmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEnvironments', $request, $callOptions); + } + + /** + * Updates the specified agent environment. + * + * This method allows you to deploy new agent versions into the environment. + * When an environment is pointed to a new agent version by setting + * `environment.agent_version`, the environment is temporarily set to the + * `LOADING` state. During that time, the environment continues serving the + * previous version of the agent. After the new agent version is done loading, + * the environment is set back to the `RUNNING` state. + * You can use "-" as Environment ID in environment name to update an agent + * version in the default environment. WARNING: this will negate all recent + * changes to the draft agent and can't be undone. You may want to save the + * draft agent to a version before calling this method. + * + * The async variant is {@see EnvironmentsClient::updateEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/update_environment.php + * + * @param UpdateEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEnvironment(UpdateEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('UpdateEnvironment', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EnvironmentsClient::getLocationAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see EnvironmentsClient::listLocationsAsync()} . + * + * @example samples/V2/EnvironmentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php new file mode 100644 index 000000000000..1aabad2caae6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php @@ -0,0 +1,387 @@ + getFulfillmentAsync(GetFulfillmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFulfillmentAsync(UpdateFulfillmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class FulfillmentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Fulfillments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/fulfillments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/fulfillments_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/fulfillments_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/fulfillments_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a fulfillment + * resource. + * + * @param string $project + * + * @return string The formatted fulfillment resource. + */ + public static function fulfillmentName(string $project): string + { + return self::getPathTemplate('fulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_fulfillment resource. + * + * @param string $project + * + * @return string The formatted project_fulfillment resource. + */ + public static function projectFulfillmentName(string $project): string + { + return self::getPathTemplate('projectFulfillment')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_fulfillment resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_fulfillment resource. + */ + public static function projectLocationFulfillmentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationFulfillment')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - fulfillment: projects/{project}/agent/fulfillment + * - projectFulfillment: projects/{project}/agent/fulfillment + * - projectLocationFulfillment: projects/{project}/locations/{location}/agent/fulfillment + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\FulfillmentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new FulfillmentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the fulfillment. + * + * The async variant is {@see FulfillmentsClient::getFulfillmentAsync()} . + * + * @example samples/V2/FulfillmentsClient/get_fulfillment.php + * + * @param GetFulfillmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Fulfillment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFulfillment(GetFulfillmentRequest $request, array $callOptions = []): Fulfillment + { + return $this->startApiCall('GetFulfillment', $request, $callOptions)->wait(); + } + + /** + * Updates the fulfillment. + * + * The async variant is {@see FulfillmentsClient::updateFulfillmentAsync()} . + * + * @example samples/V2/FulfillmentsClient/update_fulfillment.php + * + * @param UpdateFulfillmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Fulfillment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFulfillment(UpdateFulfillmentRequest $request, array $callOptions = []): Fulfillment + { + return $this->startApiCall('UpdateFulfillment', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see FulfillmentsClient::getLocationAsync()} . + * + * @example samples/V2/FulfillmentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see FulfillmentsClient::listLocationsAsync()} . + * + * @example samples/V2/FulfillmentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorEvaluationsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorEvaluationsClient.php new file mode 100644 index 000000000000..59dc12ec6b7c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorEvaluationsClient.php @@ -0,0 +1,553 @@ + createGeneratorEvaluationAsync(CreateGeneratorEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteGeneratorEvaluationAsync(DeleteGeneratorEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGeneratorEvaluationAsync(GetGeneratorEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listGeneratorEvaluationsAsync(ListGeneratorEvaluationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class GeneratorEvaluationsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.GeneratorEvaluations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generator_evaluations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generator_evaluations_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generator_evaluations_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/generator_evaluations_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a app + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * + * @return string The formatted app resource. + */ + public static function appName(string $project, string $location, string $app): string + { + return self::getPathTemplate('app')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * generator_evaluation resource. + * + * @param string $project + * @param string $location + * @param string $generator + * @param string $evaluation + * + * @return string The formatted generator_evaluation resource. + */ + public static function generatorEvaluationName(string $project, string $location, string $generator, string $evaluation): string + { + return self::getPathTemplate('generatorEvaluation')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tool + * resource. + * + * @param string $project + * @param string $location + * @param string $tool + * + * @return string The formatted tool resource. + */ + public static function toolName(string $project, string $location, string $tool): string + { + return self::getPathTemplate('tool')->render([ + 'project' => $project, + 'location' => $location, + 'tool' => $tool, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a toolset + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * @param string $toolset + * + * @return string The formatted toolset resource. + */ + public static function toolsetName(string $project, string $location, string $app, string $toolset): string + { + return self::getPathTemplate('toolset')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + 'toolset' => $toolset, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - app: projects/{project}/locations/{location}/apps/{app} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - generatorEvaluation: projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation} + * - tool: projects/{project}/locations/{location}/tools/{tool} + * - toolset: projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\GeneratorEvaluationsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new GeneratorEvaluationsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates evaluation of a generator. + * + * The async variant is + * {@see GeneratorEvaluationsClient::createGeneratorEvaluationAsync()} . + * + * @example samples/V2/GeneratorEvaluationsClient/create_generator_evaluation.php + * + * @param CreateGeneratorEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGeneratorEvaluation(CreateGeneratorEvaluationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateGeneratorEvaluation', $request, $callOptions)->wait(); + } + + /** + * Deletes an evaluation of generator. + * + * The async variant is + * {@see GeneratorEvaluationsClient::deleteGeneratorEvaluationAsync()} . + * + * @example samples/V2/GeneratorEvaluationsClient/delete_generator_evaluation.php + * + * @param DeleteGeneratorEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGeneratorEvaluation(DeleteGeneratorEvaluationRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteGeneratorEvaluation', $request, $callOptions)->wait(); + } + + /** + * Gets an evaluation of generator. + * + * The async variant is + * {@see GeneratorEvaluationsClient::getGeneratorEvaluationAsync()} . + * + * @example samples/V2/GeneratorEvaluationsClient/get_generator_evaluation.php + * + * @param GetGeneratorEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GeneratorEvaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGeneratorEvaluation(GetGeneratorEvaluationRequest $request, array $callOptions = []): GeneratorEvaluation + { + return $this->startApiCall('GetGeneratorEvaluation', $request, $callOptions)->wait(); + } + + /** + * Lists evaluations of generator. + * + * The async variant is + * {@see GeneratorEvaluationsClient::listGeneratorEvaluationsAsync()} . + * + * @example samples/V2/GeneratorEvaluationsClient/list_generator_evaluations.php + * + * @param ListGeneratorEvaluationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGeneratorEvaluations(ListGeneratorEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGeneratorEvaluations', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see GeneratorEvaluationsClient::getLocationAsync()} . + * + * @example samples/V2/GeneratorEvaluationsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see GeneratorEvaluationsClient::listLocationsAsync()} . + * + * @example samples/V2/GeneratorEvaluationsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php new file mode 100644 index 000000000000..b5e140935514 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php @@ -0,0 +1,521 @@ + createGeneratorAsync(CreateGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteGeneratorAsync(DeleteGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGeneratorAsync(GetGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface listGeneratorsAsync(ListGeneratorsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateGeneratorAsync(UpdateGeneratorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class GeneratorsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Generators'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generators_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generators_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generators_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/generators_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a app + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * + * @return string The formatted app resource. + */ + public static function appName(string $project, string $location, string $app): string + { + return self::getPathTemplate('app')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tool + * resource. + * + * @param string $project + * @param string $location + * @param string $tool + * + * @return string The formatted tool resource. + */ + public static function toolName(string $project, string $location, string $tool): string + { + return self::getPathTemplate('tool')->render([ + 'project' => $project, + 'location' => $location, + 'tool' => $tool, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a toolset + * resource. + * + * @param string $project + * @param string $location + * @param string $app + * @param string $toolset + * + * @return string The formatted toolset resource. + */ + public static function toolsetName(string $project, string $location, string $app, string $toolset): string + { + return self::getPathTemplate('toolset')->render([ + 'project' => $project, + 'location' => $location, + 'app' => $app, + 'toolset' => $toolset, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - app: projects/{project}/locations/{location}/apps/{app} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - project: projects/{project} + * - tool: projects/{project}/locations/{location}/tools/{tool} + * - toolset: projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\GeneratorsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new GeneratorsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a generator. + * + * The async variant is {@see GeneratorsClient::createGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/create_generator.php + * + * @param CreateGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGenerator(CreateGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('CreateGenerator', $request, $callOptions)->wait(); + } + + /** + * Deletes a generator. + * + * The async variant is {@see GeneratorsClient::deleteGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/delete_generator.php + * + * @param DeleteGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGenerator(DeleteGeneratorRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteGenerator', $request, $callOptions)->wait(); + } + + /** + * Retrieves a generator. + * + * The async variant is {@see GeneratorsClient::getGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/get_generator.php + * + * @param GetGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGenerator(GetGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('GetGenerator', $request, $callOptions)->wait(); + } + + /** + * Lists generators. + * + * The async variant is {@see GeneratorsClient::listGeneratorsAsync()} . + * + * @example samples/V2/GeneratorsClient/list_generators.php + * + * @param ListGeneratorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGenerators(ListGeneratorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGenerators', $request, $callOptions); + } + + /** + * Updates a generator. + * + * The async variant is {@see GeneratorsClient::updateGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/update_generator.php + * + * @param UpdateGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerator(UpdateGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('UpdateGenerator', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see GeneratorsClient::getLocationAsync()} . + * + * @example samples/V2/GeneratorsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see GeneratorsClient::listLocationsAsync()} . + * + * @example samples/V2/GeneratorsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php new file mode 100644 index 000000000000..a69f1ce9d9d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php @@ -0,0 +1,889 @@ + batchDeleteIntentsAsync(BatchDeleteIntentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface batchUpdateIntentsAsync(BatchUpdateIntentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface createIntentAsync(CreateIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteIntentAsync(DeleteIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIntentAsync(GetIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface listIntentsAsync(ListIntentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateIntentAsync(UpdateIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class IntentsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Intents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/intents_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/intents_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/intents_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/intents_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a intent + * resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted intent resource. + */ + public static function intentName(string $project, string $intent): string + { + return self::getPathTemplate('intent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_intent resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted project_intent resource. + */ + public static function projectIntentName(string $project, string $intent): string + { + return self::getPathTemplate('projectIntent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_intent resource. + * + * @param string $project + * @param string $location + * @param string $intent + * + * @return string The formatted project_location_intent resource. + */ + public static function projectLocationIntentName(string $project, string $location, string $intent): string + { + return self::getPathTemplate('projectLocationIntent')->render([ + 'project' => $project, + 'location' => $location, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - intent: projects/{project}/agent/intents/{intent} + * - projectAgent: projects/{project}/agent + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectIntent: projects/{project}/agent/intents/{intent} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\IntentsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new IntentsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes intents in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::batchDeleteIntentsAsync()} . + * + * @example samples/V2/IntentsClient/batch_delete_intents.php + * + * @param BatchDeleteIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteIntents(BatchDeleteIntentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteIntents', $request, $callOptions)->wait(); + } + + /** + * Updates/Creates multiple intents in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse] + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::batchUpdateIntentsAsync()} . + * + * @example samples/V2/IntentsClient/batch_update_intents.php + * + * @param BatchUpdateIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateIntents(BatchUpdateIntentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateIntents', $request, $callOptions)->wait(); + } + + /** + * Creates an intent in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::createIntentAsync()} . + * + * @example samples/V2/IntentsClient/create_intent.php + * + * @param CreateIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function createIntent(CreateIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('CreateIntent', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified intent and its direct or indirect followup intents. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::deleteIntentAsync()} . + * + * @example samples/V2/IntentsClient/delete_intent.php + * + * @param DeleteIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIntent(DeleteIntentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteIntent', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified intent. + * + * The async variant is {@see IntentsClient::getIntentAsync()} . + * + * @example samples/V2/IntentsClient/get_intent.php + * + * @param GetIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIntent(GetIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('GetIntent', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all intents in the specified agent. + * + * The async variant is {@see IntentsClient::listIntentsAsync()} . + * + * @example samples/V2/IntentsClient/list_intents.php + * + * @param ListIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listIntents(ListIntentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListIntents', $request, $callOptions); + } + + /** + * Updates the specified intent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::updateIntentAsync()} . + * + * @example samples/V2/IntentsClient/update_intent.php + * + * @param UpdateIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateIntent(UpdateIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('UpdateIntent', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see IntentsClient::getLocationAsync()} . + * + * @example samples/V2/IntentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see IntentsClient::listLocationsAsync()} . + * + * @example samples/V2/IntentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php new file mode 100644 index 000000000000..25d7e8ddbaa1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php @@ -0,0 +1,510 @@ + createKnowledgeBaseAsync(CreateKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface getKnowledgeBaseAsync(GetKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface listKnowledgeBasesAsync(ListKnowledgeBasesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateKnowledgeBaseAsync(UpdateKnowledgeBaseRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class KnowledgeBasesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.KnowledgeBases'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/knowledge_bases_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/knowledge_bases_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/knowledge_bases_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/knowledge_bases_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectKnowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - projectLocationKnowledgeBase: projects/{project}/locations/{location}/knowledgeBases/{knowledge_base} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\KnowledgeBasesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new KnowledgeBasesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::createKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/create_knowledge_base.php + * + * @param CreateKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function createKnowledgeBase(CreateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('CreateKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::deleteKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/delete_knowledge_base.php + * + * @param DeleteKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteKnowledgeBase(DeleteKnowledgeBaseRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::getKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/get_knowledge_base.php + * + * @param GetKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function getKnowledgeBase(GetKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('GetKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all knowledge bases of the specified agent. + * + * The async variant is {@see KnowledgeBasesClient::listKnowledgeBasesAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/list_knowledge_bases.php + * + * @param ListKnowledgeBasesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listKnowledgeBases(ListKnowledgeBasesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListKnowledgeBases', $request, $callOptions); + } + + /** + * Updates the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::updateKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/update_knowledge_base.php + * + * @param UpdateKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateKnowledgeBase(UpdateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('UpdateKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see KnowledgeBasesClient::getLocationAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see KnowledgeBasesClient::listLocationsAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php new file mode 100644 index 000000000000..a805737e90e0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php @@ -0,0 +1,1108 @@ + analyzeContentAsync(AnalyzeContentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createParticipantAsync(CreateParticipantRequest $request, array $optionalArgs = []) + * @method PromiseInterface getParticipantAsync(GetParticipantRequest $request, array $optionalArgs = []) + * @method PromiseInterface listParticipantsAsync(ListParticipantsRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestArticlesAsync(SuggestArticlesRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestFaqAnswersAsync(SuggestFaqAnswersRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestKnowledgeAssistAsync(SuggestKnowledgeAssistRequest $request, array $optionalArgs = []) + * @method PromiseInterface suggestSmartRepliesAsync(SuggestSmartRepliesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateParticipantAsync(UpdateParticipantRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ParticipantsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Participants'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/participants_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/participants_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/participants_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/participants_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a conversation + * resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted conversation resource. + */ + public static function conversationName(string $project, string $conversation): string + { + return self::getPathTemplate('conversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('message')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a participant + * resource. + * + * @param string $project + * @param string $conversation + * @param string $participant + * + * @return string The formatted participant resource. + */ + public static function participantName(string $project, string $conversation, string $participant): string + { + return self::getPathTemplate('participant')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation resource. + * + * @param string $project + * @param string $conversation + * + * @return string The formatted project_conversation resource. + */ + public static function projectConversationName(string $project, string $conversation): string + { + return self::getPathTemplate('projectConversation')->render([ + 'project' => $project, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_message resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted project_conversation_message resource. + */ + public static function projectConversationMessageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('projectConversationMessage')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_participant resource. + * + * @param string $project + * @param string $conversation + * @param string $participant + * + * @return string The formatted project_conversation_participant resource. + */ + public static function projectConversationParticipantName(string $project, string $conversation, string $participant): string + { + return self::getPathTemplate('projectConversationParticipant')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_environment_user_session_entity_type resource. + */ + public static function projectEnvironmentUserSessionEntityTypeName(string $project, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * + * @return string The formatted project_location_conversation resource. + */ + public static function projectLocationConversationName(string $project, string $location, string $conversation): string + { + return self::getPathTemplate('projectLocationConversation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_message resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $message + * + * @return string The formatted project_location_conversation_message resource. + */ + public static function projectLocationConversationMessageName(string $project, string $location, string $conversation, string $message): string + { + return self::getPathTemplate('projectLocationConversationMessage')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_participant resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * @param string $participant + * + * @return string The formatted project_location_conversation_participant resource. + */ + public static function projectLocationConversationParticipantName(string $project, string $location, string $conversation, string $participant): string + { + return self::getPathTemplate('projectLocationConversationParticipant')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_environment_user_session_entity_type resource. + */ + public static function projectLocationEnvironmentUserSessionEntityTypeName(string $project, string $location, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_session_entity_type resource. + */ + public static function projectLocationSessionEntityTypeName(string $project, string $location, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted project_session_entity_type resource. + */ + public static function projectSessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('projectSessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted session_entity_type resource. + */ + public static function sessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('sessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - conversation: projects/{project}/conversations/{conversation} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - participant: projects/{project}/conversations/{conversation}/participants/{participant} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - projectConversation: projects/{project}/conversations/{conversation} + * - projectConversationMessage: projects/{project}/conversations/{conversation}/messages/{message} + * - projectConversationParticipant: projects/{project}/conversations/{conversation}/participants/{participant} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectEnvironmentUserSessionEntityType: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationConversation: projects/{project}/locations/{location}/conversations/{conversation} + * - projectLocationConversationMessage: projects/{project}/locations/{location}/conversations/{conversation}/messages/{message} + * - projectLocationConversationParticipant: projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationEnvironmentUserSessionEntityType: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectLocationSessionEntityType: projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - projectSessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * - session: projects/{project}/agent/sessions/{session} + * - sessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ParticipantsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ParticipantsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds a text (chat, for example), or audio (phone recording, for example) + * message from a participant into the conversation. + * + * Note: Always use agent versions for production traffic + * sent to virtual agents. See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * The async variant is {@see ParticipantsClient::analyzeContentAsync()} . + * + * @example samples/V2/ParticipantsClient/analyze_content.php + * + * @param AnalyzeContentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalyzeContentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeContent(AnalyzeContentRequest $request, array $callOptions = []): AnalyzeContentResponse + { + return $this->startApiCall('AnalyzeContent', $request, $callOptions)->wait(); + } + + /** + * Creates a new participant in a conversation. + * + * The async variant is {@see ParticipantsClient::createParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/create_participant.php + * + * @param CreateParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function createParticipant(CreateParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('CreateParticipant', $request, $callOptions)->wait(); + } + + /** + * Retrieves a conversation participant. + * + * The async variant is {@see ParticipantsClient::getParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/get_participant.php + * + * @param GetParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function getParticipant(GetParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('GetParticipant', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all participants in the specified conversation. + * + * The async variant is {@see ParticipantsClient::listParticipantsAsync()} . + * + * @example samples/V2/ParticipantsClient/list_participants.php + * + * @param ListParticipantsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listParticipants(ListParticipantsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListParticipants', $request, $callOptions); + } + + /** + * Adds a text (chat, for example), or audio (phone recording, for example) + * message from a participant into the conversation. + * Note: This method is only available through the gRPC API (not REST). + * + * The top-level message sent to the client by the server is + * `StreamingAnalyzeContentResponse`. Multiple response messages can be + * returned in order. The first one or more messages contain the + * `recognition_result` field. Each result represents a more complete + * transcript of what the user said. The next message contains the + * `reply_text` field and potentially the `reply_audio` field. The message can + * also contain the `automated_agent_reply` field. + * + * Note: Always use agent versions for production traffic + * sent to virtual agents. See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * @example samples/V2/ParticipantsClient/streaming_analyze_content.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingAnalyzeContent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingAnalyzeContent', null, $callOptions); + } + + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestArticlesAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_articles.php + * + * @param SuggestArticlesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestArticlesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestArticles(SuggestArticlesRequest $request, array $callOptions = []): SuggestArticlesResponse + { + return $this->startApiCall('SuggestArticles', $request, $callOptions)->wait(); + } + + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestFaqAnswersAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_faq_answers.php + * + * @param SuggestFaqAnswersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestFaqAnswersResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestFaqAnswers(SuggestFaqAnswersRequest $request, array $callOptions = []): SuggestFaqAnswersResponse + { + return $this->startApiCall('SuggestFaqAnswers', $request, $callOptions)->wait(); + } + + /** + * Gets knowledge assist suggestions based on historical messages. + * + * The async variant is {@see ParticipantsClient::suggestKnowledgeAssistAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_knowledge_assist.php + * + * @param SuggestKnowledgeAssistRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestKnowledgeAssistResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestKnowledgeAssist(SuggestKnowledgeAssistRequest $request, array $callOptions = []): SuggestKnowledgeAssistResponse + { + return $this->startApiCall('SuggestKnowledgeAssist', $request, $callOptions)->wait(); + } + + /** + * Gets smart replies for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestSmartRepliesAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_smart_replies.php + * + * @param SuggestSmartRepliesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestSmartRepliesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestSmartReplies(SuggestSmartRepliesRequest $request, array $callOptions = []): SuggestSmartRepliesResponse + { + return $this->startApiCall('SuggestSmartReplies', $request, $callOptions)->wait(); + } + + /** + * Updates the specified participant. + * + * The async variant is {@see ParticipantsClient::updateParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/update_participant.php + * + * @param UpdateParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateParticipant(UpdateParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('UpdateParticipant', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ParticipantsClient::getLocationAsync()} . + * + * @example samples/V2/ParticipantsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ParticipantsClient::listLocationsAsync()} . + * + * @example samples/V2/ParticipantsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php new file mode 100644 index 000000000000..57cc0976b9ae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php @@ -0,0 +1,662 @@ + createSessionEntityTypeAsync(CreateSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSessionEntityTypeAsync(DeleteSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSessionEntityTypeAsync(GetSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSessionEntityTypesAsync(ListSessionEntityTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSessionEntityTypeAsync(UpdateSessionEntityTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class SessionEntityTypesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/session_entity_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/session_entity_types_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/session_entity_types_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/session_entity_types_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_environment_user_session_entity_type resource. + */ + public static function projectEnvironmentUserSessionEntityTypeName(string $project, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_environment_user_session_entity_type resource. + */ + public static function projectLocationEnvironmentUserSessionEntityTypeName(string $project, string $location, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_session_entity_type resource. + */ + public static function projectLocationSessionEntityTypeName(string $project, string $location, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted project_session_entity_type resource. + */ + public static function projectSessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('projectSessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted session_entity_type resource. + */ + public static function sessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('sessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionEntityType: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionEntityType: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionEntityType: projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * - session: projects/{project}/agent/sessions/{session} + * - sessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\SessionEntityTypesClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SessionEntityTypesClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a session entity type. + * + * If the specified session entity type already exists, overrides the session + * entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::createSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/create_session_entity_type.php + * + * @param CreateSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSessionEntityType(CreateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('CreateSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::deleteSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/delete_session_entity_type.php + * + * @param DeleteSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSessionEntityType(DeleteSessionEntityTypeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::getSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/get_session_entity_type.php + * + * @param GetSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSessionEntityType(GetSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('GetSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all session entity types in the specified session. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::listSessionEntityTypesAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/list_session_entity_types.php + * + * @param ListSessionEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSessionEntityTypes(ListSessionEntityTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSessionEntityTypes', $request, $callOptions); + } + + /** + * Updates the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::updateSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/update_session_entity_type.php + * + * @param UpdateSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSessionEntityType(UpdateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('UpdateSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SessionEntityTypesClient::getLocationAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see SessionEntityTypesClient::listLocationsAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php new file mode 100644 index 000000000000..3ad8b54d18c9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php @@ -0,0 +1,707 @@ + detectIntentAsync(DetectIntentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class SessionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Sessions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/sessions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/sessions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/sessions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/sessions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a phrase_set + * resource. + * + * @param string $project + * @param string $location + * @param string $phraseSet + * + * @return string The formatted phrase_set resource. + */ + public static function phraseSetName(string $project, string $location, string $phraseSet): string + { + return self::getPathTemplate('phraseSet')->render([ + 'project' => $project, + 'location' => $location, + 'phrase_set' => $phraseSet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_environment_user_session_entity_type resource. + */ + public static function projectEnvironmentUserSessionEntityTypeName(string $project, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_environment_user_session_entity_type resource. + */ + public static function projectLocationEnvironmentUserSessionEntityTypeName(string $project, string $location, string $environment, string $user, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_entity_type resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $entityType + * + * @return string The formatted project_location_session_entity_type resource. + */ + public static function projectLocationSessionEntityTypeName(string $project, string $location, string $session, string $entityType): string + { + return self::getPathTemplate('projectLocationSessionEntityType')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted project_session_entity_type resource. + */ + public static function projectSessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('projectSessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * session_entity_type resource. + * + * @param string $project + * @param string $session + * @param string $entityType + * + * @return string The formatted session_entity_type resource. + */ + public static function sessionEntityTypeName(string $project, string $session, string $entityType): string + { + return self::getPathTemplate('sessionEntityType')->render([ + 'project' => $project, + 'session' => $session, + 'entity_type' => $entityType, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - phraseSet: projects/{project}/locations/{location}/phraseSets/{phrase_set} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectEnvironmentUserSessionEntityType: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationEnvironmentUserSessionEntityType: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectLocationSessionEntityType: projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - projectSessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * - session: projects/{project}/agent/sessions/{session} + * - sessionEntityType: projects/{project}/agent/sessions/{session}/entityTypes/{entity_type} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\SessionsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SessionsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Processes a natural language query and returns structured, actionable data + * as a result. This method is not idempotent, because it may cause contexts + * and session entity types to be updated, which in turn might affect + * results of future queries. + * + * If you might use + * [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + * or other CCAI products now or in the future, consider using + * [AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * instead of `DetectIntent`. `AnalyzeContent` has additional + * functionality for Agent Assist and other CCAI products. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * The async variant is {@see SessionsClient::detectIntentAsync()} . + * + * @example samples/V2/SessionsClient/detect_intent.php + * + * @param DetectIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DetectIntentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detectIntent(DetectIntentRequest $request, array $callOptions = []): DetectIntentResponse + { + return $this->startApiCall('DetectIntent', $request, $callOptions)->wait(); + } + + /** + * Processes a natural language query in audio format in a streaming fashion + * and returns structured, actionable data as a result. This method is only + * available via the gRPC API (not REST). + * + * If you might use + * [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + * or other CCAI products now or in the future, consider using + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has + * additional functionality for Agent Assist and other CCAI products. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * @example samples/V2/SessionsClient/streaming_detect_intent.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingDetectIntent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingDetectIntent', null, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SessionsClient::getLocationAsync()} . + * + * @example samples/V2/SessionsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see SessionsClient::listLocationsAsync()} . + * + * @example samples/V2/SessionsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SipTrunksClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SipTrunksClient.php new file mode 100644 index 000000000000..5df651c95f72 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SipTrunksClient.php @@ -0,0 +1,457 @@ + createSipTrunkAsync(CreateSipTrunkRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSipTrunkAsync(DeleteSipTrunkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSipTrunkAsync(GetSipTrunkRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSipTrunksAsync(ListSipTrunksRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSipTrunkAsync(UpdateSipTrunkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class SipTrunksClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.SipTrunks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/sip_trunks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/sip_trunks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/sip_trunks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/sip_trunks_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a sip_trunk + * resource. + * + * @param string $project + * @param string $location + * @param string $siptrunk + * + * @return string The formatted sip_trunk resource. + */ + public static function sipTrunkName(string $project, string $location, string $siptrunk): string + { + return self::getPathTemplate('sipTrunk')->render([ + 'project' => $project, + 'location' => $location, + 'siptrunk' => $siptrunk, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - sipTrunk: projects/{project}/locations/{location}/sipTrunks/{siptrunk} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\SipTrunksClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SipTrunksClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a SipTrunk for a specified location. + * + * The async variant is {@see SipTrunksClient::createSipTrunkAsync()} . + * + * @example samples/V2/SipTrunksClient/create_sip_trunk.php + * + * @param CreateSipTrunkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SipTrunk + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSipTrunk(CreateSipTrunkRequest $request, array $callOptions = []): SipTrunk + { + return $this->startApiCall('CreateSipTrunk', $request, $callOptions)->wait(); + } + + /** + * Deletes a specified SipTrunk. + * + * The async variant is {@see SipTrunksClient::deleteSipTrunkAsync()} . + * + * @example samples/V2/SipTrunksClient/delete_sip_trunk.php + * + * @param DeleteSipTrunkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSipTrunk(DeleteSipTrunkRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSipTrunk', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified SipTrunk. + * + * The async variant is {@see SipTrunksClient::getSipTrunkAsync()} . + * + * @example samples/V2/SipTrunksClient/get_sip_trunk.php + * + * @param GetSipTrunkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SipTrunk + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSipTrunk(GetSipTrunkRequest $request, array $callOptions = []): SipTrunk + { + return $this->startApiCall('GetSipTrunk', $request, $callOptions)->wait(); + } + + /** + * Returns a list of SipTrunks in the specified location. + * + * The async variant is {@see SipTrunksClient::listSipTrunksAsync()} . + * + * @example samples/V2/SipTrunksClient/list_sip_trunks.php + * + * @param ListSipTrunksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSipTrunks(ListSipTrunksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSipTrunks', $request, $callOptions); + } + + /** + * Updates the specified SipTrunk. + * + * The async variant is {@see SipTrunksClient::updateSipTrunkAsync()} . + * + * @example samples/V2/SipTrunksClient/update_sip_trunk.php + * + * @param UpdateSipTrunkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SipTrunk + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSipTrunk(UpdateSipTrunkRequest $request, array $callOptions = []): SipTrunk + { + return $this->startApiCall('UpdateSipTrunk', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SipTrunksClient::getLocationAsync()} . + * + * @example samples/V2/SipTrunksClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see SipTrunksClient::listLocationsAsync()} . + * + * @example samples/V2/SipTrunksClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ToolsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ToolsClient.php new file mode 100644 index 000000000000..0f249839c68c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ToolsClient.php @@ -0,0 +1,501 @@ + createToolAsync(CreateToolRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteToolAsync(DeleteToolRequest $request, array $optionalArgs = []) + * @method PromiseInterface getToolAsync(GetToolRequest $request, array $optionalArgs = []) + * @method PromiseInterface listToolsAsync(ListToolsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateToolAsync(UpdateToolRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class ToolsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Tools'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tools_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tools_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tools_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tools_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $version + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $version): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $namespace, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a tool + * resource. + * + * @param string $project + * @param string $location + * @param string $tool + * + * @return string The formatted tool resource. + */ + public static function toolName(string $project, string $location, string $tool): string + { + return self::getPathTemplate('tool')->render([ + 'project' => $project, + 'location' => $location, + 'tool' => $tool, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * - tool: projects/{project}/locations/{location}/tools/{tool} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\ToolsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new ToolsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a tool. + * + * The async variant is {@see ToolsClient::createToolAsync()} . + * + * @example samples/V2/ToolsClient/create_tool.php + * + * @param CreateToolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Tool + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTool(CreateToolRequest $request, array $callOptions = []): Tool + { + return $this->startApiCall('CreateTool', $request, $callOptions)->wait(); + } + + /** + * Deletes a tool. + * + * The async variant is {@see ToolsClient::deleteToolAsync()} . + * + * @example samples/V2/ToolsClient/delete_tool.php + * + * @param DeleteToolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTool(DeleteToolRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTool', $request, $callOptions)->wait(); + } + + /** + * Retrieves a tool. + * + * The async variant is {@see ToolsClient::getToolAsync()} . + * + * @example samples/V2/ToolsClient/get_tool.php + * + * @param GetToolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Tool + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTool(GetToolRequest $request, array $callOptions = []): Tool + { + return $this->startApiCall('GetTool', $request, $callOptions)->wait(); + } + + /** + * Lists tools. + * + * The async variant is {@see ToolsClient::listToolsAsync()} . + * + * @example samples/V2/ToolsClient/list_tools.php + * + * @param ListToolsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTools(ListToolsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTools', $request, $callOptions); + } + + /** + * Updates a tool. + * + * The async variant is {@see ToolsClient::updateToolAsync()} . + * + * @example samples/V2/ToolsClient/update_tool.php + * + * @param UpdateToolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Tool + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateTool(UpdateToolRequest $request, array $callOptions = []): Tool + { + return $this->startApiCall('UpdateTool', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ToolsClient::getLocationAsync()} . + * + * @example samples/V2/ToolsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see ToolsClient::listLocationsAsync()} . + * + * @example samples/V2/ToolsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php new file mode 100644 index 000000000000..6842522b8255 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php @@ -0,0 +1,531 @@ + createVersionAsync(CreateVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteVersionAsync(DeleteVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getVersionAsync(GetVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listVersionsAsync(ListVersionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateVersionAsync(UpdateVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class VersionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.dialogflow.v2.Versions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/versions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/versions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/versions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/versions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_version resource. + * + * @param string $project + * @param string $location + * @param string $version + * + * @return string The formatted project_location_version resource. + */ + public static function projectLocationVersionName(string $project, string $location, string $version): string + { + return self::getPathTemplate('projectLocationVersion')->render([ + 'project' => $project, + 'location' => $location, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_version resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted project_version resource. + */ + public static function projectVersionName(string $project, string $version): string + { + return self::getPathTemplate('projectVersion')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a version + * resource. + * + * @param string $project + * @param string $version + * + * @return string The formatted version resource. + */ + public static function versionName(string $project, string $version): string + { + return self::getPathTemplate('version')->render([ + 'project' => $project, + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - projectAgent: projects/{project}/agent + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationVersion: projects/{project}/locations/{location}/agent/versions/{version} + * - projectVersion: projects/{project}/agent/versions/{version} + * - version: projects/{project}/agent/versions/{version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'dialogflow.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\Dialogflow\V2\VersionsClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new VersionsClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates an agent version. + * + * The new version points to the agent instance in the "default" environment. + * + * The async variant is {@see VersionsClient::createVersionAsync()} . + * + * @example samples/V2/VersionsClient/create_version.php + * + * @param CreateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function createVersion(CreateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('CreateVersion', $request, $callOptions)->wait(); + } + + /** + * Delete the specified agent version. + * + * The async variant is {@see VersionsClient::deleteVersionAsync()} . + * + * @example samples/V2/VersionsClient/delete_version.php + * + * @param DeleteVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteVersion(DeleteVersionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteVersion', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent version. + * + * The async variant is {@see VersionsClient::getVersionAsync()} . + * + * @example samples/V2/VersionsClient/get_version.php + * + * @param GetVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVersion(GetVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('GetVersion', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all versions of the specified agent. + * + * The async variant is {@see VersionsClient::listVersionsAsync()} . + * + * @example samples/V2/VersionsClient/list_versions.php + * + * @param ListVersionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVersions(ListVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVersions', $request, $callOptions); + } + + /** + * Updates the specified agent version. + * + * Note that this method does not allow you to update the state of the agent + * the given version points to. It allows you to update only mutable + * properties of the version resource. + * + * The async variant is {@see VersionsClient::updateVersionAsync()} . + * + * @example samples/V2/VersionsClient/update_version.php + * + * @param UpdateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVersion(UpdateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('UpdateVersion', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see VersionsClient::getLocationAsync()} . + * + * @example samples/V2/VersionsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * This method lists locations based on the resource scope provided in + * the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + * **Global locations**: If `name` is empty, the method lists the + * public locations available to all projects. * **Project-specific + * locations**: If `name` follows the format + * `projects/{project}`, the method lists locations visible to that + * specific project. This includes public, private, or other + * project-specific locations enabled for the project. + * + * For gRPC and client library implementations, the resource name is + * passed as the `name` field. For direct service calls, the resource + * name is + * incorporated into the request path based on the specific service + * implementation and version. + * + * The async variant is {@see VersionsClient::listLocationsAsync()} . + * + * @example samples/V2/VersionsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Dialogflow/v2/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..ec57f923a0c3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/gapic_metadata.json @@ -0,0 +1,1077 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.dialogflow.v2", + "libraryPackage": "Google\\Cloud\\Dialogflow\\V2", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "AgentsGapicClient", + "rpcs": { + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "ExportAgent": { + "methods": [ + "exportAgent" + ] + }, + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "GetValidationResult": { + "methods": [ + "getValidationResult" + ] + }, + "ImportAgent": { + "methods": [ + "importAgent" + ] + }, + "RestoreAgent": { + "methods": [ + "restoreAgent" + ] + }, + "SearchAgents": { + "methods": [ + "searchAgents" + ] + }, + "SetAgent": { + "methods": [ + "setAgent" + ] + }, + "TrainAgent": { + "methods": [ + "trainAgent" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Tools": { + "clients": { + "grpc": { + "libraryClient": "ToolsGapicClient", + "rpcs": { + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "ListTools": { + "methods": [ + "listTools" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Generators": { + "clients": { + "grpc": { + "libraryClient": "GeneratorsGapicClient", + "rpcs": { + "CreateGenerator": { + "methods": [ + "createGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "deleteGenerator" + ] + }, + "GetGenerator": { + "methods": [ + "getGenerator" + ] + }, + "ListGenerators": { + "methods": [ + "listGenerators" + ] + }, + "UpdateGenerator": { + "methods": [ + "updateGenerator" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Contexts": { + "clients": { + "grpc": { + "libraryClient": "ContextsGapicClient", + "rpcs": { + "CreateContext": { + "methods": [ + "createContext" + ] + }, + "DeleteAllContexts": { + "methods": [ + "deleteAllContexts" + ] + }, + "DeleteContext": { + "methods": [ + "deleteContext" + ] + }, + "GetContext": { + "methods": [ + "getContext" + ] + }, + "ListContexts": { + "methods": [ + "listContexts" + ] + }, + "UpdateContext": { + "methods": [ + "updateContext" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Intents": { + "clients": { + "grpc": { + "libraryClient": "IntentsGapicClient", + "rpcs": { + "BatchDeleteIntents": { + "methods": [ + "batchDeleteIntents" + ] + }, + "BatchUpdateIntents": { + "methods": [ + "batchUpdateIntents" + ] + }, + "CreateIntent": { + "methods": [ + "createIntent" + ] + }, + "DeleteIntent": { + "methods": [ + "deleteIntent" + ] + }, + "GetIntent": { + "methods": [ + "getIntent" + ] + }, + "ListIntents": { + "methods": [ + "listIntents" + ] + }, + "UpdateIntent": { + "methods": [ + "updateIntent" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "EntityTypesGapicClient", + "rpcs": { + "BatchCreateEntities": { + "methods": [ + "batchCreateEntities" + ] + }, + "BatchDeleteEntities": { + "methods": [ + "batchDeleteEntities" + ] + }, + "BatchDeleteEntityTypes": { + "methods": [ + "batchDeleteEntityTypes" + ] + }, + "BatchUpdateEntities": { + "methods": [ + "batchUpdateEntities" + ] + }, + "BatchUpdateEntityTypes": { + "methods": [ + "batchUpdateEntityTypes" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "SessionEntityTypesGapicClient", + "rpcs": { + "CreateSessionEntityType": { + "methods": [ + "createSessionEntityType" + ] + }, + "DeleteSessionEntityType": { + "methods": [ + "deleteSessionEntityType" + ] + }, + "GetSessionEntityType": { + "methods": [ + "getSessionEntityType" + ] + }, + "ListSessionEntityTypes": { + "methods": [ + "listSessionEntityTypes" + ] + }, + "UpdateSessionEntityType": { + "methods": [ + "updateSessionEntityType" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "SessionsGapicClient", + "rpcs": { + "DetectIntent": { + "methods": [ + "detectIntent" + ] + }, + "StreamingDetectIntent": { + "methods": [ + "streamingDetectIntent" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Participants": { + "clients": { + "grpc": { + "libraryClient": "ParticipantsGapicClient", + "rpcs": { + "AnalyzeContent": { + "methods": [ + "analyzeContent" + ] + }, + "CreateParticipant": { + "methods": [ + "createParticipant" + ] + }, + "GetParticipant": { + "methods": [ + "getParticipant" + ] + }, + "ListParticipants": { + "methods": [ + "listParticipants" + ] + }, + "StreamingAnalyzeContent": { + "methods": [ + "streamingAnalyzeContent" + ] + }, + "SuggestArticles": { + "methods": [ + "suggestArticles" + ] + }, + "SuggestFaqAnswers": { + "methods": [ + "suggestFaqAnswers" + ] + }, + "SuggestKnowledgeAssist": { + "methods": [ + "suggestKnowledgeAssist" + ] + }, + "SuggestSmartReplies": { + "methods": [ + "suggestSmartReplies" + ] + }, + "UpdateParticipant": { + "methods": [ + "updateParticipant" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "AnswerRecords": { + "clients": { + "grpc": { + "libraryClient": "AnswerRecordsGapicClient", + "rpcs": { + "ListAnswerRecords": { + "methods": [ + "listAnswerRecords" + ] + }, + "UpdateAnswerRecord": { + "methods": [ + "updateAnswerRecord" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "ConversationProfiles": { + "clients": { + "grpc": { + "libraryClient": "ConversationProfilesGapicClient", + "rpcs": { + "ClearSuggestionFeatureConfig": { + "methods": [ + "clearSuggestionFeatureConfig" + ] + }, + "CreateConversationProfile": { + "methods": [ + "createConversationProfile" + ] + }, + "DeleteConversationProfile": { + "methods": [ + "deleteConversationProfile" + ] + }, + "GetConversationProfile": { + "methods": [ + "getConversationProfile" + ] + }, + "ListConversationProfiles": { + "methods": [ + "listConversationProfiles" + ] + }, + "SetSuggestionFeatureConfig": { + "methods": [ + "setSuggestionFeatureConfig" + ] + }, + "UpdateConversationProfile": { + "methods": [ + "updateConversationProfile" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Conversations": { + "clients": { + "grpc": { + "libraryClient": "ConversationsGapicClient", + "rpcs": { + "CompleteConversation": { + "methods": [ + "completeConversation" + ] + }, + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "GenerateStatelessSuggestion": { + "methods": [ + "generateStatelessSuggestion" + ] + }, + "GenerateStatelessSummary": { + "methods": [ + "generateStatelessSummary" + ] + }, + "GenerateSuggestions": { + "methods": [ + "generateSuggestions" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "IngestContextReferences": { + "methods": [ + "ingestContextReferences" + ] + }, + "ListConversations": { + "methods": [ + "listConversations" + ] + }, + "ListMessages": { + "methods": [ + "listMessages" + ] + }, + "SearchKnowledge": { + "methods": [ + "searchKnowledge" + ] + }, + "SuggestConversationSummary": { + "methods": [ + "suggestConversationSummary" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "ConversationDatasets": { + "clients": { + "grpc": { + "libraryClient": "ConversationDatasetsGapicClient", + "rpcs": { + "CreateConversationDataset": { + "methods": [ + "createConversationDataset" + ] + }, + "DeleteConversationDataset": { + "methods": [ + "deleteConversationDataset" + ] + }, + "GetConversationDataset": { + "methods": [ + "getConversationDataset" + ] + }, + "ImportConversationData": { + "methods": [ + "importConversationData" + ] + }, + "ListConversationDatasets": { + "methods": [ + "listConversationDatasets" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "ConversationModels": { + "clients": { + "grpc": { + "libraryClient": "ConversationModelsGapicClient", + "rpcs": { + "CreateConversationModel": { + "methods": [ + "createConversationModel" + ] + }, + "CreateConversationModelEvaluation": { + "methods": [ + "createConversationModelEvaluation" + ] + }, + "DeleteConversationModel": { + "methods": [ + "deleteConversationModel" + ] + }, + "DeployConversationModel": { + "methods": [ + "deployConversationModel" + ] + }, + "GetConversationModel": { + "methods": [ + "getConversationModel" + ] + }, + "GetConversationModelEvaluation": { + "methods": [ + "getConversationModelEvaluation" + ] + }, + "ListConversationModelEvaluations": { + "methods": [ + "listConversationModelEvaluations" + ] + }, + "ListConversationModels": { + "methods": [ + "listConversationModels" + ] + }, + "UndeployConversationModel": { + "methods": [ + "undeployConversationModel" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Documents": { + "clients": { + "grpc": { + "libraryClient": "DocumentsGapicClient", + "rpcs": { + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "ExportDocument": { + "methods": [ + "exportDocument" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments" + ] + }, + "ReloadDocument": { + "methods": [ + "reloadDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "EncryptionSpecService": { + "clients": { + "grpc": { + "libraryClient": "EncryptionSpecServiceGapicClient", + "rpcs": { + "GetEncryptionSpec": { + "methods": [ + "getEncryptionSpec" + ] + }, + "InitializeEncryptionSpec": { + "methods": [ + "initializeEncryptionSpec" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Fulfillments": { + "clients": { + "grpc": { + "libraryClient": "FulfillmentsGapicClient", + "rpcs": { + "GetFulfillment": { + "methods": [ + "getFulfillment" + ] + }, + "UpdateFulfillment": { + "methods": [ + "updateFulfillment" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsGapicClient", + "rpcs": { + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "GetEnvironmentHistory": { + "methods": [ + "getEnvironmentHistory" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "GeneratorEvaluations": { + "clients": { + "grpc": { + "libraryClient": "GeneratorEvaluationsGapicClient", + "rpcs": { + "CreateGeneratorEvaluation": { + "methods": [ + "createGeneratorEvaluation" + ] + }, + "DeleteGeneratorEvaluation": { + "methods": [ + "deleteGeneratorEvaluation" + ] + }, + "GetGeneratorEvaluation": { + "methods": [ + "getGeneratorEvaluation" + ] + }, + "ListGeneratorEvaluations": { + "methods": [ + "listGeneratorEvaluations" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "KnowledgeBases": { + "clients": { + "grpc": { + "libraryClient": "KnowledgeBasesGapicClient", + "rpcs": { + "CreateKnowledgeBase": { + "methods": [ + "createKnowledgeBase" + ] + }, + "DeleteKnowledgeBase": { + "methods": [ + "deleteKnowledgeBase" + ] + }, + "GetKnowledgeBase": { + "methods": [ + "getKnowledgeBase" + ] + }, + "ListKnowledgeBases": { + "methods": [ + "listKnowledgeBases" + ] + }, + "UpdateKnowledgeBase": { + "methods": [ + "updateKnowledgeBase" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "SipTrunks": { + "clients": { + "grpc": { + "libraryClient": "SipTrunksGapicClient", + "rpcs": { + "CreateSipTrunk": { + "methods": [ + "createSipTrunk" + ] + }, + "DeleteSipTrunk": { + "methods": [ + "deleteSipTrunk" + ] + }, + "GetSipTrunk": { + "methods": [ + "getSipTrunk" + ] + }, + "ListSipTrunks": { + "methods": [ + "listSipTrunks" + ] + }, + "UpdateSipTrunk": { + "methods": [ + "updateSipTrunk" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "Versions": { + "clients": { + "grpc": { + "libraryClient": "VersionsGapicClient", + "rpcs": { + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "ListVersions": { + "methods": [ + "listVersions" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_client_config.json new file mode 100644 index 000000000000..a03813a8fbc5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Agents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "DeleteAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetValidationResult": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RestoreAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchAgents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TrainAgent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_descriptor_config.php new file mode 100644 index 000000000000..ad3845afca37 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_descriptor_config.php @@ -0,0 +1,214 @@ + [ + 'google.cloud.dialogflow.v2.Agents' => [ + 'ExportAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ExportAgentResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ImportAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'TrainAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Agent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetValidationResult' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ValidationResult', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAgents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAgents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SearchAgentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SetAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Agent', + 'headerParams' => [ + [ + 'keyName' => 'agent.parent', + 'fieldAccessors' => [ + 'getAgent', + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php new file mode 100644 index 000000000000..4aea4ec4c927 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php @@ -0,0 +1,270 @@ + [ + 'google.cloud.dialogflow.v2.Agents' => [ + 'DeleteAgent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*}/agent', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ExportAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:export', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:export', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetAgent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetValidationResult' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent/validationResult', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent/validationResult', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ImportAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:import', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:import', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:restore', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:restore', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAgents' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:search', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{agent.parent=projects/*}/agent', + 'body' => 'agent', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{agent.parent=projects/*/locations/*}/agent', + 'body' => 'agent', + ], + ], + 'placeholders' => [ + 'agent.parent' => [ + 'getters' => [ + 'getAgent', + 'getParent', + ], + ], + ], + ], + 'TrainAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:train', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:train', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json new file mode 100644 index 000000000000..2114a79c3ccc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.AnswerRecords": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ListAnswerRecords": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAnswerRecord": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php new file mode 100644 index 000000000000..75984c3cc408 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php @@ -0,0 +1,121 @@ + [ + 'google.cloud.dialogflow.v2.AnswerRecords' => [ + 'ListAnswerRecords' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAnswerRecords', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListAnswerRecordsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAnswerRecord' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\AnswerRecord', + 'headerParams' => [ + [ + 'keyName' => 'answer_record.name', + 'fieldAccessors' => [ + 'getAnswerRecord', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'answerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'app' => 'projects/{project}/locations/{location}/apps/{app}', + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'intent' => 'projects/{project}/agent/intents/{intent}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectAnswerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectIntent' => 'projects/{project}/agent/intents/{intent}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationAnswerRecord' => 'projects/{project}/locations/{location}/answerRecords/{answer_record}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'tool' => 'projects/{project}/locations/{location}/tools/{tool}', + 'toolset' => 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php new file mode 100644 index 000000000000..543db558f12e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.dialogflow.v2.AnswerRecords' => [ + 'ListAnswerRecords' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/answerRecords', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/answerRecords', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAnswerRecord' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{answer_record.name=projects/*/answerRecords/*}', + 'body' => 'answer_record', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}', + 'body' => 'answer_record', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'answer_record.name' => [ + 'getters' => [ + 'getAnswerRecord', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json new file mode 100644 index 000000000000..405824724392 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Contexts": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteAllContexts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListContexts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php new file mode 100644 index 000000000000..707c44cec19d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.dialogflow.v2.Contexts' => [ + 'CreateContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAllContexts' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListContexts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getContexts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListContextsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'context.name', + 'fieldAccessors' => [ + 'getContext', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php new file mode 100644 index 000000000000..e0de23c564f9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php @@ -0,0 +1,265 @@ + [ + 'google.cloud.dialogflow.v2.Contexts' => [ + 'CreateContext' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'body' => 'context', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + 'body' => 'context', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + 'body' => 'context', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + 'body' => 'context', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAllContexts' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteContext' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/contexts/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetContext' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/contexts/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListContexts' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateContext' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/agent/sessions/*/contexts/*}', + 'body' => 'context', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + 'body' => 'context', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}', + 'body' => 'context', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + 'body' => 'context', + ], + ], + 'placeholders' => [ + 'context.name' => [ + 'getters' => [ + 'getContext', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json new file mode 100644 index 000000000000..bbee4eabff14 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationDatasets": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportConversationData": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php new file mode 100644 index 000000000000..8f56e4d9f55b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.dialogflow.v2.ConversationDatasets' => [ + 'CreateConversationDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationDataset', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationDatasetOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeleteConversationDatasetOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportConversationData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ImportConversationDataOperationResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\ImportConversationDataOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationDataset', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationDatasets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationDatasets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationDatasetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'conversationDataset' => 'projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php new file mode 100644 index 000000000000..6fce97e63a9c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php @@ -0,0 +1,182 @@ + [ + 'google.cloud.dialogflow.v2.ConversationDatasets' => [ + 'CreateConversationDataset' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationDatasets', + 'body' => 'conversation_dataset', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationDataset' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationDataset' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationDatasets/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportConversationData' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationDatasets/*}:importConversationData', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationDatasets' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationDatasets', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationDatasets', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json new file mode 100644 index 000000000000..ecdf8c5a3de4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationModels": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversationModelEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeployConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationModelEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationModelEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationModels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UndeployConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php new file mode 100644 index 000000000000..c8bf357edb7b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php @@ -0,0 +1,233 @@ + [ + 'google.cloud.dialogflow.v2.ConversationModels' => [ + 'CreateConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationModel', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversationModelEvaluation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeleteConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeployConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeployConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeployConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\UndeployConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationModel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModelEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationModelEvaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationModelEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationModelEvaluations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationModelEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListConversationModels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationModels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'conversationDataset' => 'projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationModelEvaluation' => 'projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationModelEvaluation' => 'projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationModelEvaluation' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php new file mode 100644 index 000000000000..b512278aa16f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.dialogflow.v2.ConversationModels' => [ + 'CreateConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationModels', + 'body' => 'conversation_model', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationModels', + 'body' => 'conversation_model', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversationModelEvaluation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationModel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeployConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}:deploy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}:deploy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModel' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModelEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*/evaluations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*/evaluations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationModelEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversationModels/*}/evaluations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListConversationModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationModels', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationModels', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}:undeploy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}:undeploy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json new file mode 100644 index 000000000000..2898ad3018aa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationProfiles": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ClearSuggestionFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetSuggestionFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php new file mode 100644 index 000000000000..b678750a517e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php @@ -0,0 +1,191 @@ + [ + 'google.cloud.dialogflow.v2.ConversationProfiles' => [ + 'ClearSuggestionFeatureConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationProfile', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile', + 'fieldAccessors' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'SetSuggestionFeatureConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationProfile', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile', + 'fieldAccessors' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'CreateConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationProfiles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationProfiles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationProfilesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile.name', + 'fieldAccessors' => [ + 'getConversationProfile', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'cXSecuritySettings' => 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationProfile' => 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php new file mode 100644 index 000000000000..4b8748b9fe28 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.dialogflow.v2.ConversationProfiles' => [ + 'ClearSuggestionFeatureConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation_profile' => [ + 'getters' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'CreateConversationProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationProfiles', + 'body' => 'conversation_profile', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationProfiles', + 'body' => 'conversation_profile', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationProfile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/conversationProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationProfile' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationProfiles' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationProfiles', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationProfiles', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetSuggestionFeatureConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation_profile' => [ + 'getters' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'UpdateConversationProfile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{conversation_profile.name=projects/*/conversationProfiles/*}', + 'body' => 'conversation_profile', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}', + 'body' => 'conversation_profile', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'conversation_profile.name' => [ + 'getters' => [ + 'getConversationProfile', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json new file mode 100644 index 000000000000..a80f9673386f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Conversations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CompleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateStatelessSuggestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateStatelessSummary": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateSuggestions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "IngestContextReferences": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMessages": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchKnowledge": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestConversationSummary": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php new file mode 100644 index 000000000000..c469695926e1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php @@ -0,0 +1,251 @@ + [ + 'google.cloud.dialogflow.v2.Conversations' => [ + 'CompleteConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSuggestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSuggestionResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'stateless_conversation.parent', + 'fieldAccessors' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + 'GenerateSuggestions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateSuggestionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'GetConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'IngestContextReferences' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\IngestContextReferencesResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'ListConversations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMessages', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListMessagesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchKnowledge' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SearchKnowledgeResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'SuggestConversationSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'app' => 'projects/{project}/locations/{location}/apps/{app}', + 'cXSecuritySettings' => 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + 'conversation' => 'projects/{project}/conversations/{conversation}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'dataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectConversation' => 'projects/{project}/conversations/{conversation}', + 'projectConversationMessage' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationCollectionDataStore' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}', + 'projectLocationConversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', + 'projectLocationConversationMessage' => 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationProfile' => 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}', + 'projectLocationDataStore' => 'projects/{project}/locations/{location}/dataStores/{data_store}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + 'tool' => 'projects/{project}/locations/{location}/tools/{tool}', + 'toolset' => 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php new file mode 100644 index 000000000000..4a354b783447 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php @@ -0,0 +1,311 @@ + [ + 'google.cloud.dialogflow.v2.Conversations' => [ + 'CompleteConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*}:complete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}:complete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversations', + 'body' => 'conversation', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversations', + 'body' => 'conversation', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSuggestion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'stateless_conversation.parent' => [ + 'getters' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + 'GenerateSuggestions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:generate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + 'GetConversation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'IngestContextReferences' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences', + 'body' => '*', + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + 'ListConversations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversations', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/messages', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/messages', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchKnowledge' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/suggestions:searchKnowledge', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestConversationSummary' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json new file mode 100644 index 000000000000..aaddca9c9fcc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Documents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReloadDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php new file mode 100644 index 000000000000..23ee924e2ebe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.dialogflow.v2.Documents' => [ + 'CreateDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ImportDocumentsResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ReloadDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'document.name', + 'fieldAccessors' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Document', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDocuments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDocuments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListDocumentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php new file mode 100644 index 000000000000..a138d4b382a5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Documents' => [ + 'CreateDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents', + 'body' => 'document', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents', + 'body' => 'document', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/knowledgeBases/*}/documents', + 'body' => 'document', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}:export', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents:import', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDocuments' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/knowledgeBases/*}/documents', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ReloadDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/knowledgeBases/*/documents/*}', + 'body' => 'document', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}', + 'body' => 'document', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}', + 'body' => 'document', + ], + ], + 'placeholders' => [ + 'document.name' => [ + 'getters' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json new file mode 100644 index 000000000000..ad9d113f458b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.EncryptionSpecService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InitializeEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php new file mode 100644 index 000000000000..5a62913a12d0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php @@ -0,0 +1,97 @@ + [ + 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ + 'InitializeEncryptionSpec' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'encryption_spec.name', + 'fieldAccessors' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], + 'GetEncryptionSpec' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EncryptionSpec', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'encryptionSpec' => 'projects/{project}/locations/{location}/encryptionSpec', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php new file mode 100644 index 000000000000..36e95f799812 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php @@ -0,0 +1,130 @@ + [ + 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ + 'GetEncryptionSpec' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/encryptionSpec}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InitializeEncryptionSpec' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize', + 'body' => '*', + 'placeholders' => [ + 'encryption_spec.name' => [ + 'getters' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json new file mode 100644 index 000000000000..0380bfe8f674 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.EntityTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchCreateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchDeleteEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchDeleteEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php new file mode 100644 index 000000000000..d469b7e0a1a2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php @@ -0,0 +1,234 @@ + [ + 'google.cloud.dialogflow.v2.EntityTypes' => [ + 'BatchCreateEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntityTypes' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntityTypes' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\BatchUpdateEntityTypesResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEntityTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntityTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListEntityTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'entity_type.name', + 'fieldAccessors' => [ + 'getEntityType', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'entityType' => 'projects/{project}/agent/entityTypes/{entity_type}', + 'projectAgent' => 'projects/{project}/agent', + 'projectEntityType' => 'projects/{project}/agent/entityTypes/{entity_type}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEntityType' => 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php new file mode 100644 index 000000000000..58e3534d9dde --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php @@ -0,0 +1,291 @@ + [ + 'google.cloud.dialogflow.v2.EntityTypes' => [ + 'BatchCreateEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntityTypes' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntityTypes' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntityType' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes', + 'body' => 'entity_type', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes', + 'body' => 'entity_type', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntityType' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEntityType' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEntityTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntityType' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{entity_type.name=projects/*/agent/entityTypes/*}', + 'body' => 'entity_type', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}', + 'body' => 'entity_type', + ], + ], + 'placeholders' => [ + 'entity_type.name' => [ + 'getters' => [ + 'getEntityType', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json new file mode 100644 index 000000000000..00d6f74b6016 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Environments": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEnvironmentHistory": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEnvironments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php new file mode 100644 index 000000000000..b18757884f32 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php @@ -0,0 +1,165 @@ + [ + 'google.cloud.dialogflow.v2.Environments' => [ + 'CreateEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironmentHistory' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EnvironmentHistory', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListEnvironments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEnvironments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListEnvironmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'environment.name', + 'fieldAccessors' => [ + 'getEnvironment', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'environment' => 'projects/{project}/agent/environments/{environment}', + 'fulfillment' => 'projects/{project}/agent/fulfillment', + 'projectAgent' => 'projects/{project}/agent', + 'projectEnvironment' => 'projects/{project}/agent/environments/{environment}', + 'projectFulfillment' => 'projects/{project}/agent/fulfillment', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEnvironment' => 'projects/{project}/locations/{location}/agent/environments/{environment}', + 'projectLocationFulfillment' => 'projects/{project}/locations/{location}/agent/fulfillment', + 'projectLocationVersion' => 'projects/{project}/locations/{location}/agent/versions/{version}', + 'projectVersion' => 'projects/{project}/agent/versions/{version}', + 'version' => 'projects/{project}/agent/versions/{version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php new file mode 100644 index 000000000000..da85e68fdb50 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php @@ -0,0 +1,225 @@ + [ + 'google.cloud.dialogflow.v2.Environments' => [ + 'CreateEnvironment' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/environments', + 'body' => 'environment', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/environments', + 'body' => 'environment', + 'queryParams' => [ + 'environment_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'environment_id', + ], + ], + 'DeleteEnvironment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironment' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironmentHistory' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*}/history', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*}/history', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListEnvironments' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/environments', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/environments', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEnvironment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{environment.name=projects/*/agent/environments/*}', + 'body' => 'environment', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{environment.name=projects/*/locations/*/agent/environments/*}', + 'body' => 'environment', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'environment.name' => [ + 'getters' => [ + 'getEnvironment', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json new file mode 100644 index 000000000000..8e6cc14bb9c3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Fulfillments": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetFulfillment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateFulfillment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php new file mode 100644 index 000000000000..a295b6c7e880 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php @@ -0,0 +1,92 @@ + [ + 'google.cloud.dialogflow.v2.Fulfillments' => [ + 'GetFulfillment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Fulfillment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFulfillment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Fulfillment', + 'headerParams' => [ + [ + 'keyName' => 'fulfillment.name', + 'fieldAccessors' => [ + 'getFulfillment', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'fulfillment' => 'projects/{project}/agent/fulfillment', + 'projectFulfillment' => 'projects/{project}/agent/fulfillment', + 'projectLocationFulfillment' => 'projects/{project}/locations/{location}/agent/fulfillment', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php new file mode 100644 index 000000000000..4a9ab9b79ad5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.dialogflow.v2.Fulfillments' => [ + 'GetFulfillment' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/fulfillment}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/fulfillment}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFulfillment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{fulfillment.name=projects/*/agent/fulfillment}', + 'body' => 'fulfillment', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}', + 'body' => 'fulfillment', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'fulfillment.name' => [ + 'getters' => [ + 'getFulfillment', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_client_config.json new file mode 100644 index 000000000000..9730504eedc8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.GeneratorEvaluations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateGeneratorEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteGeneratorEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGeneratorEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGeneratorEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_descriptor_config.php new file mode 100644 index 000000000000..181af24e6cc0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_descriptor_config.php @@ -0,0 +1,132 @@ + [ + 'google.cloud.dialogflow.v2.GeneratorEvaluations' => [ + 'CreateGeneratorEvaluation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\GeneratorEvaluation', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\GeneratorEvaluationOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGeneratorEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGeneratorEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GeneratorEvaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGeneratorEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGeneratorEvaluations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListGeneratorEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'app' => 'projects/{project}/locations/{location}/apps/{app}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'generatorEvaluation' => 'projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}', + 'tool' => 'projects/{project}/locations/{location}/tools/{tool}', + 'toolset' => 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_rest_client_config.php new file mode 100644 index 000000000000..daac366e1d2d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generator_evaluations_rest_client_config.php @@ -0,0 +1,151 @@ + [ + 'google.cloud.dialogflow.v2.GeneratorEvaluations' => [ + 'CreateGeneratorEvaluation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/generators/*}/evaluations', + 'body' => 'generator_evaluation', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGeneratorEvaluation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*/evaluations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGeneratorEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*/evaluations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListGeneratorEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/generators/*}/evaluations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json new file mode 100644 index 000000000000..d4ccea7d4677 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Generators": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGenerators": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php new file mode 100644 index 000000000000..a4ace0398bcd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php @@ -0,0 +1,138 @@ + [ + 'google.cloud.dialogflow.v2.Generators' => [ + 'CreateGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGenerators' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGenerators', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListGeneratorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'generator.name', + 'fieldAccessors' => [ + 'getGenerator', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'app' => 'projects/{project}/locations/{location}/apps/{app}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'project' => 'projects/{project}', + 'tool' => 'projects/{project}/locations/{location}/tools/{tool}', + 'toolset' => 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php new file mode 100644 index 000000000000..c2dac1dabe19 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php @@ -0,0 +1,177 @@ + [ + 'google.cloud.dialogflow.v2.Generators' => [ + 'CreateGenerator' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', + 'body' => 'generator', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/generators', + 'body' => 'generator', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGenerator' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGenerator' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListGenerators' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/generators', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerator' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generator.name=projects/*/locations/*/generators/*}', + 'body' => 'generator', + 'placeholders' => [ + 'generator.name' => [ + 'getters' => [ + 'getGenerator', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json new file mode 100644 index 000000000000..f6d3f00e1293 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Intents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchDeleteIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php new file mode 100644 index 000000000000..96c3a916e2ae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php @@ -0,0 +1,187 @@ + [ + 'google.cloud.dialogflow.v2.Intents' => [ + 'BatchDeleteIntents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateIntents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\BatchUpdateIntentsResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListIntents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getIntents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListIntentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'intent.name', + 'fieldAccessors' => [ + 'getIntent', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'intent' => 'projects/{project}/agent/intents/{intent}', + 'projectAgent' => 'projects/{project}/agent', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectIntent' => 'projects/{project}/agent/intents/{intent}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php new file mode 100644 index 000000000000..736b02d23094 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php @@ -0,0 +1,242 @@ + [ + 'google.cloud.dialogflow.v2.Intents' => [ + 'BatchDeleteIntents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateIntents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIntent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents', + 'body' => 'intent', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents', + 'body' => 'intent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteIntent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/intents/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/intents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIntent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/intents/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/intents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListIntents' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*}/intents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*}/intents', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateIntent' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{intent.name=projects/*/agent/intents/*}', + 'body' => 'intent', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{intent.name=projects/*/locations/*/agent/intents/*}', + 'body' => 'intent', + ], + ], + 'placeholders' => [ + 'intent.name' => [ + 'getters' => [ + 'getIntent', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json new file mode 100644 index 000000000000..8b18c4c682f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.KnowledgeBases": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListKnowledgeBases": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php new file mode 100644 index 000000000000..8cf0cfe4e963 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php @@ -0,0 +1,138 @@ + [ + 'google.cloud.dialogflow.v2.KnowledgeBases' => [ + 'CreateKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListKnowledgeBases' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getKnowledgeBases', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListKnowledgeBasesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'knowledge_base.name', + 'fieldAccessors' => [ + 'getKnowledgeBase', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php new file mode 100644 index 000000000000..e12a1d4399d3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php @@ -0,0 +1,218 @@ + [ + 'google.cloud.dialogflow.v2.KnowledgeBases' => [ + 'CreateKnowledgeBase' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/knowledgeBases', + 'body' => 'knowledge_base', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/knowledgeBases', + 'body' => 'knowledge_base', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/knowledgeBases', + 'body' => 'knowledge_base', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteKnowledgeBase' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetKnowledgeBase' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListKnowledgeBases' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/knowledgeBases', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/knowledgeBases', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/knowledgeBases', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateKnowledgeBase' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/knowledgeBases/*}', + 'body' => 'knowledge_base', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}', + 'body' => 'knowledge_base', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}', + 'body' => 'knowledge_base', + ], + ], + 'placeholders' => [ + 'knowledge_base.name' => [ + 'getters' => [ + 'getKnowledgeBase', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json new file mode 100644 index 000000000000..b779759a50fd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json @@ -0,0 +1,124 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Participants": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [], + "no_retry_2_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 1800000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 1800000, + "total_timeout_millis": 1800000 + } + }, + "methods": { + "AnalyzeContent": { + "timeout_millis": 220000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "CreateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListParticipants": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StreamingAnalyzeContent": { + "timeout_millis": 220000 + }, + "SuggestArticles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestFaqAnswers": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestKnowledgeAssist": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestSmartReplies": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php new file mode 100644 index 000000000000..23cab12d5452 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php @@ -0,0 +1,213 @@ + [ + 'google.cloud.dialogflow.v2.Participants' => [ + 'AnalyzeContent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\AnalyzeContentResponse', + 'headerParams' => [ + [ + 'keyName' => 'participant', + 'fieldAccessors' => [ + 'getParticipant', + ], + ], + ], + ], + 'CreateParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListParticipants' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getParticipants', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListParticipantsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'StreamingAnalyzeContent' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\StreamingAnalyzeContentResponse', + ], + 'SuggestArticles' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestArticlesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestFaqAnswers' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestKnowledgeAssist' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestSmartReplies' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'participant.name', + 'fieldAccessors' => [ + 'getParticipant', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'conversation' => 'projects/{project}/conversations/{conversation}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'participant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'projectConversation' => 'projects/{project}/conversations/{conversation}', + 'projectConversationMessage' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'projectConversationParticipant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationConversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', + 'projectLocationConversationMessage' => 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}', + 'projectLocationConversationParticipant' => 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php new file mode 100644 index 000000000000..061f4e41c3ea --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Participants' => [ + 'AnalyzeContent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'participant' => [ + 'getters' => [ + 'getParticipant', + ], + ], + ], + ], + 'CreateParticipant' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/participants', + 'body' => 'participant', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/participants', + 'body' => 'participant', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetParticipant' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*/participants/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*/participants/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListParticipants' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/participants', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/participants', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestArticles' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestFaqAnswers' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestKnowledgeAssist' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestSmartReplies' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateParticipant' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{participant.name=projects/*/conversations/*/participants/*}', + 'body' => 'participant', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}', + 'body' => 'participant', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'participant.name' => [ + 'getters' => [ + 'getParticipant', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json new file mode 100644 index 000000000000..521ba47be243 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.SessionEntityTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSessionEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php new file mode 100644 index 000000000000..1be480b8a800 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php @@ -0,0 +1,143 @@ + [ + 'google.cloud.dialogflow.v2.SessionEntityTypes' => [ + 'CreateSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSessionEntityTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSessionEntityTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListSessionEntityTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'session_entity_type.name', + 'fieldAccessors' => [ + 'getSessionEntityType', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php new file mode 100644 index 000000000000..cb7dacefc14b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.dialogflow.v2.SessionEntityTypes' => [ + 'CreateSessionEntityType' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSessionEntityType' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSessionEntityType' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSessionEntityTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/entityTypes', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSessionEntityType' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + ], + 'placeholders' => [ + 'session_entity_type.name' => [ + 'getters' => [ + 'getSessionEntityType', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json new file mode 100644 index 000000000000..4967706e6ba8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Sessions": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + } + }, + "methods": { + "DetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "StreamingDetectIntent": { + "timeout_millis": 220000 + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php new file mode 100644 index 000000000000..6f5c3092e8eb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php @@ -0,0 +1,99 @@ + [ + 'google.cloud.dialogflow.v2.Sessions' => [ + 'DetectIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\DetectIntentResponse', + 'headerParams' => [ + [ + 'keyName' => 'session', + 'fieldAccessors' => [ + 'getSession', + ], + ], + ], + ], + 'StreamingDetectIntent' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\StreamingDetectIntentResponse', + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'phraseSet' => 'projects/{project}/locations/{location}/phraseSets/{phrase_set}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php new file mode 100644 index 000000000000..74e16be60ba5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.dialogflow.v2.Sessions' => [ + 'DetectIntent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/agent/sessions/*}:detectIntent', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/locations/*/agent/sessions/*}:detectIntent', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'session' => [ + 'getters' => [ + 'getSession', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_client_config.json new file mode 100644 index 000000000000..ab8db6c010da --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.SipTrunks": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateSipTrunk": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSipTrunk": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSipTrunk": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSipTrunks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSipTrunk": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_descriptor_config.php new file mode 100644 index 000000000000..81951f775c71 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_descriptor_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.dialogflow.v2.SipTrunks' => [ + 'CreateSipTrunk' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SipTrunk', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSipTrunk' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSipTrunk' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SipTrunk', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSipTrunks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSipTrunks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListSipTrunksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSipTrunk' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SipTrunk', + 'headerParams' => [ + [ + 'keyName' => 'sip_trunk.name', + 'fieldAccessors' => [ + 'getSipTrunk', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'location' => 'projects/{project}/locations/{location}', + 'sipTrunk' => 'projects/{project}/locations/{location}/sipTrunks/{siptrunk}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_rest_client_config.php new file mode 100644 index 000000000000..a590484c2f15 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sip_trunks_rest_client_config.php @@ -0,0 +1,164 @@ + [ + 'google.cloud.dialogflow.v2.SipTrunks' => [ + 'CreateSipTrunk' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/sipTrunks', + 'body' => 'sip_trunk', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSipTrunk' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/sipTrunks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSipTrunk' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/sipTrunks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSipTrunks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/sipTrunks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSipTrunk' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{sip_trunk.name=projects/*/locations/*/sipTrunks/*}', + 'body' => 'sip_trunk', + 'placeholders' => [ + 'sip_trunk.name' => [ + 'getters' => [ + 'getSipTrunk', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_client_config.json new file mode 100644 index 000000000000..027c000a214d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Tools": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateTool": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTool": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTool": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTools": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateTool": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_descriptor_config.php new file mode 100644 index 000000000000..d412f85b0928 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_descriptor_config.php @@ -0,0 +1,137 @@ + [ + 'google.cloud.dialogflow.v2.Tools' => [ + 'CreateTool' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Tool', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTool' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTool' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Tool', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTools' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTools', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListToolsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateTool' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Tool', + 'headerParams' => [ + [ + 'keyName' => 'tool.name', + 'fieldAccessors' => [ + 'getTool', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'location' => 'projects/{project}/locations/{location}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', + 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', + 'tool' => 'projects/{project}/locations/{location}/tools/{tool}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_rest_client_config.php new file mode 100644 index 000000000000..9116ddefe4b9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/tools_rest_client_config.php @@ -0,0 +1,164 @@ + [ + 'google.cloud.dialogflow.v2.Tools' => [ + 'CreateTool' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/tools', + 'body' => 'tool', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteTool' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/tools/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTool' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/tools/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTools' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/tools', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateTool' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{tool.name=projects/*/locations/*/tools/*}', + 'body' => 'tool', + 'placeholders' => [ + 'tool.name' => [ + 'getters' => [ + 'getTool', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json new file mode 100644 index 000000000000..e4e6368ea17f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Versions": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php new file mode 100644 index 000000000000..1ac4fea22edc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php @@ -0,0 +1,139 @@ + [ + 'google.cloud.dialogflow.v2.Versions' => [ + 'CreateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'version.name', + 'fieldAccessors' => [ + 'getVersion', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'projectAgent' => 'projects/{project}/agent', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationVersion' => 'projects/{project}/locations/{location}/agent/versions/{version}', + 'projectVersion' => 'projects/{project}/agent/versions/{version}', + 'version' => 'projects/{project}/agent/versions/{version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php new file mode 100644 index 000000000000..52784e1291b6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php @@ -0,0 +1,202 @@ + [ + 'google.cloud.dialogflow.v2.Versions' => [ + 'CreateVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/versions', + 'body' => 'version', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/versions', + 'body' => 'version', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteVersion' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/versions/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/versions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetVersion' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/versions/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/versions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/versions', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/versions', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVersion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{version.name=projects/*/agent/versions/*}', + 'body' => 'version', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{version.name=projects/*/locations/*/agent/versions/*}', + 'body' => 'version', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'version.name' => [ + 'getters' => [ + 'getVersion', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AgentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AgentsClientTest.php new file mode 100644 index 000000000000..afd668860066 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AgentsClientTest.php @@ -0,0 +1,1091 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AgentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AgentsClient($options); + } + + /** @test */ + public function deleteAgentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new DeleteAgentRequest()) + ->setParent($formattedParent); + $gapicClient->deleteAgent($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/DeleteAgent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAgentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new DeleteAgentRequest()) + ->setParent($formattedParent); + try { + $gapicClient->deleteAgent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function exportAgentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $agentUri2 = 'agentUri21997190245'; + $expectedResponse = new ExportAgentResponse(); + $expectedResponse->setAgentUri($agentUri2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $agentUri = 'agentUri-1700713166'; + $request = (new ExportAgentRequest()) + ->setParent($formattedParent) + ->setAgentUri($agentUri); + $response = $gapicClient->exportAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/ExportAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAgentUri(); + $this->assertProtobufEquals($agentUri, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAgentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportAgentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $agentUri = 'agentUri-1700713166'; + $request = (new ExportAgentRequest()) + ->setParent($formattedParent) + ->setAgentUri($agentUri); + $response = $gapicClient->exportAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportAgentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getAgentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $parent2 = 'parent21175163357'; + $displayName = 'displayName1615086568'; + $defaultLanguageCode = 'defaultLanguageCode856575222'; + $timeZone = 'timeZone36848094'; + $description = 'description-1724546052'; + $avatarUri = 'avatarUri-402824826'; + $enableLogging = false; + $classificationThreshold = 10917768; + $expectedResponse = new Agent(); + $expectedResponse->setParent($parent2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDefaultLanguageCode($defaultLanguageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setDescription($description); + $expectedResponse->setAvatarUri($avatarUri); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setClassificationThreshold($classificationThreshold); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new GetAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->getAgent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/GetAgent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAgentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new GetAgentRequest()) + ->setParent($formattedParent); + try { + $gapicClient->getAgent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getValidationResultTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ValidationResult(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new GetValidationResultRequest()) + ->setParent($formattedParent); + $response = $gapicClient->getValidationResult($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/GetValidationResult', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getValidationResultExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new GetValidationResultRequest()) + ->setParent($formattedParent); + try { + $gapicClient->getValidationResult($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importAgentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ImportAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->importAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/ImportAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importAgentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importAgentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ImportAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->importAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importAgentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreAgentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new RestoreAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->restoreAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/RestoreAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreAgentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreAgentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new RestoreAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->restoreAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreAgentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function searchAgentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $agentsElement = new Agent(); + $agents = [ + $agentsElement, + ]; + $expectedResponse = new SearchAgentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAgents($agents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new SearchAgentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->searchAgents($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAgents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/SearchAgents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchAgentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new SearchAgentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->searchAgents($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setAgentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $parent = 'parent-995424086'; + $displayName = 'displayName1615086568'; + $defaultLanguageCode = 'defaultLanguageCode856575222'; + $timeZone = 'timeZone36848094'; + $description = 'description-1724546052'; + $avatarUri = 'avatarUri-402824826'; + $enableLogging = false; + $classificationThreshold = 10917768; + $expectedResponse = new Agent(); + $expectedResponse->setParent($parent); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDefaultLanguageCode($defaultLanguageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setDescription($description); + $expectedResponse->setAvatarUri($avatarUri); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setClassificationThreshold($classificationThreshold); + $transport->addResponse($expectedResponse); + // Mock request + $agent = new Agent(); + $agentParent = $gapicClient->projectName('[PROJECT]'); + $agent->setParent($agentParent); + $agentDisplayName = 'agentDisplayName2121176616'; + $agent->setDisplayName($agentDisplayName); + $agentDefaultLanguageCode = 'agentDefaultLanguageCode-1905463551'; + $agent->setDefaultLanguageCode($agentDefaultLanguageCode); + $agentTimeZone = 'agentTimeZone-453669314'; + $agent->setTimeZone($agentTimeZone); + $request = (new SetAgentRequest()) + ->setAgent($agent); + $response = $gapicClient->setAgent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/SetAgent', $actualFuncCall); + $actualValue = $actualRequestObject->getAgent(); + $this->assertProtobufEquals($agent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setAgentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $agent = new Agent(); + $agentParent = $gapicClient->projectName('[PROJECT]'); + $agent->setParent($agentParent); + $agentDisplayName = 'agentDisplayName2121176616'; + $agent->setDisplayName($agentDisplayName); + $agentDefaultLanguageCode = 'agentDefaultLanguageCode-1905463551'; + $agent->setDefaultLanguageCode($agentDefaultLanguageCode); + $agentTimeZone = 'agentTimeZone-453669314'; + $agent->setTimeZone($agentTimeZone); + $request = (new SetAgentRequest()) + ->setAgent($agent); + try { + $gapicClient->setAgent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function trainAgentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/trainAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/trainAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new TrainAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->trainAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/TrainAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/trainAgentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function trainAgentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/trainAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new TrainAgentRequest()) + ->setParent($formattedParent); + $response = $gapicClient->trainAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/trainAgentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAgentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new DeleteAgentRequest()) + ->setParent($formattedParent); + $gapicClient->deleteAgentAsync($request)->wait(); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Agents/DeleteAgent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AnswerRecordsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AnswerRecordsClientTest.php new file mode 100644 index 000000000000..26e5606ee89b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AnswerRecordsClientTest.php @@ -0,0 +1,377 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AnswerRecordsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AnswerRecordsClient($options); + } + + /** @test */ + public function listAnswerRecordsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $answerRecordsElement = new AnswerRecord(); + $answerRecords = [ + $answerRecordsElement, + ]; + $expectedResponse = new ListAnswerRecordsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAnswerRecords($answerRecords); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListAnswerRecordsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAnswerRecords($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAnswerRecords()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.AnswerRecords/ListAnswerRecords', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAnswerRecordsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListAnswerRecordsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listAnswerRecords($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAnswerRecordTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new AnswerRecord(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $answerRecord = new AnswerRecord(); + $answerRecordAnswerFeedback = new AnswerFeedback(); + $answerRecord->setAnswerFeedback($answerRecordAnswerFeedback); + $updateMask = new FieldMask(); + $request = (new UpdateAnswerRecordRequest()) + ->setAnswerRecord($answerRecord) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateAnswerRecord($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.AnswerRecords/UpdateAnswerRecord', $actualFuncCall); + $actualValue = $actualRequestObject->getAnswerRecord(); + $this->assertProtobufEquals($answerRecord, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateAnswerRecordExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $answerRecord = new AnswerRecord(); + $answerRecordAnswerFeedback = new AnswerFeedback(); + $answerRecord->setAnswerFeedback($answerRecordAnswerFeedback); + $updateMask = new FieldMask(); + $request = (new UpdateAnswerRecordRequest()) + ->setAnswerRecord($answerRecord) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateAnswerRecord($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAnswerRecordsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $answerRecordsElement = new AnswerRecord(); + $answerRecords = [ + $answerRecordsElement, + ]; + $expectedResponse = new ListAnswerRecordsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAnswerRecords($answerRecords); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListAnswerRecordsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAnswerRecordsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAnswerRecords()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.AnswerRecords/ListAnswerRecords', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ContextsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ContextsClientTest.php new file mode 100644 index 000000000000..048cc260e159 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ContextsClientTest.php @@ -0,0 +1,640 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ContextsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ContextsClient($options); + } + + /** @test */ + public function createContextTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $lifespanCount = 1178775510; + $expectedResponse = new Context(); + $expectedResponse->setName($name); + $expectedResponse->setLifespanCount($lifespanCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $context = new Context(); + $contextName = 'contextName-103041830'; + $context->setName($contextName); + $request = (new CreateContextRequest()) + ->setParent($formattedParent) + ->setContext($context); + $response = $gapicClient->createContext($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/CreateContext', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getContext(); + $this->assertProtobufEquals($context, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createContextExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $context = new Context(); + $contextName = 'contextName-103041830'; + $context->setName($contextName); + $request = (new CreateContextRequest()) + ->setParent($formattedParent) + ->setContext($context); + try { + $gapicClient->createContext($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAllContextsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $request = (new DeleteAllContextsRequest()) + ->setParent($formattedParent); + $gapicClient->deleteAllContexts($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/DeleteAllContexts', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAllContextsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $request = (new DeleteAllContextsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->deleteAllContexts($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteContextTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + $request = (new DeleteContextRequest()) + ->setName($formattedName); + $gapicClient->deleteContext($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/DeleteContext', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteContextExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + $request = (new DeleteContextRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteContext($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getContextTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $lifespanCount = 1178775510; + $expectedResponse = new Context(); + $expectedResponse->setName($name2); + $expectedResponse->setLifespanCount($lifespanCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + $request = (new GetContextRequest()) + ->setName($formattedName); + $response = $gapicClient->getContext($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/GetContext', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getContextExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + $request = (new GetContextRequest()) + ->setName($formattedName); + try { + $gapicClient->getContext($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listContextsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $contextsElement = new Context(); + $contexts = [ + $contextsElement, + ]; + $expectedResponse = new ListContextsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setContexts($contexts); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $request = (new ListContextsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listContexts($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getContexts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/ListContexts', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listContextsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $request = (new ListContextsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listContexts($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateContextTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $lifespanCount = 1178775510; + $expectedResponse = new Context(); + $expectedResponse->setName($name); + $expectedResponse->setLifespanCount($lifespanCount); + $transport->addResponse($expectedResponse); + // Mock request + $context = new Context(); + $contextName = 'contextName-103041830'; + $context->setName($contextName); + $request = (new UpdateContextRequest()) + ->setContext($context); + $response = $gapicClient->updateContext($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/UpdateContext', $actualFuncCall); + $actualValue = $actualRequestObject->getContext(); + $this->assertProtobufEquals($context, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateContextExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $context = new Context(); + $contextName = 'contextName-103041830'; + $context->setName($contextName); + $request = (new UpdateContextRequest()) + ->setContext($context); + try { + $gapicClient->updateContext($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createContextAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $lifespanCount = 1178775510; + $expectedResponse = new Context(); + $expectedResponse->setName($name); + $expectedResponse->setLifespanCount($lifespanCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $context = new Context(); + $contextName = 'contextName-103041830'; + $context->setName($contextName); + $request = (new CreateContextRequest()) + ->setParent($formattedParent) + ->setContext($context); + $response = $gapicClient->createContextAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Contexts/CreateContext', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getContext(); + $this->assertProtobufEquals($context, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php new file mode 100644 index 000000000000..ccc63da21e93 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php @@ -0,0 +1,825 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationDatasetsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationDatasetsClient($options); + } + + /** @test */ + public function createConversationDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + $response = $gapicClient->createConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getConversationDataset(); + $this->assertProtobufEquals($conversationDataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationDatasetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + $response = $gapicClient->createConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new DeleteConversationDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/DeleteConversationDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationDatasetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new DeleteConversationDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationDatasetTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getConversationDatasetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new GetConversationDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->getConversationDataset($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/GetConversationDataset', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationDatasetExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new GetConversationDatasetRequest()) + ->setName($formattedName); + try { + $gapicClient->getConversationDataset($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importConversationDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importConversationDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $conversationDataset = 'conversationDataset1344013500'; + $importCount = 1721296907; + $expectedResponse = new ImportConversationDataOperationResponse(); + $expectedResponse->setConversationDataset($conversationDataset); + $expectedResponse->setImportCount($importCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importConversationDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportConversationDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importConversationData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/ImportConversationData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importConversationDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importConversationDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importConversationDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportConversationDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importConversationData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importConversationDataTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listConversationDatasetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationDatasetsElement = new ConversationDataset(); + $conversationDatasets = [ + $conversationDatasetsElement, + ]; + $expectedResponse = new ListConversationDatasetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationDatasets($conversationDatasets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationDatasetsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listConversationDatasets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationDatasets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/ListConversationDatasets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationDatasetsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationDatasetsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listConversationDatasets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationDatasetAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + $response = $gapicClient->createConversationDatasetAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getConversationDataset(); + $this->assertProtobufEquals($conversationDataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php new file mode 100644 index 000000000000..d813791129e6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php @@ -0,0 +1,1203 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationModelsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationModelsClient($options); + } + + /** @test */ + public function createConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + $response = $gapicClient->createConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationModel(); + $this->assertProtobufEquals($conversationModel, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + $response = $gapicClient->createConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationModelEvaluationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $rawHumanEvalTemplateCsv = 'rawHumanEvalTemplateCsv-1393080869'; + $expectedResponse = new ConversationModelEvaluation(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setRawHumanEvalTemplateCsv($rawHumanEvalTemplateCsv); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelEvaluationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); + $conversationModelEvaluation = new ConversationModelEvaluation(); + $request = (new CreateConversationModelEvaluationRequest()) + ->setParent($formattedParent) + ->setConversationModelEvaluation($conversationModelEvaluation); + $response = $gapicClient->createConversationModelEvaluation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModelEvaluation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getConversationModelEvaluation(); + $this->assertProtobufEquals($conversationModelEvaluation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelEvaluationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationModelEvaluationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); + $conversationModelEvaluation = new ConversationModelEvaluation(); + $request = (new CreateConversationModelEvaluationRequest()) + ->setParent($formattedParent) + ->setConversationModelEvaluation($conversationModelEvaluation); + $response = $gapicClient->createConversationModelEvaluation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelEvaluationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new DeleteConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deleteConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/DeleteConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new DeleteConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deleteConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new DeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/DeployConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new DeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getConversationModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelRequest()) + ->setName($name); + $response = $gapicClient->getConversationModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/GetConversationModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationModelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelRequest()) + ->setName($name); + try { + $gapicClient->getConversationModel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationModelEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $rawHumanEvalTemplateCsv = 'rawHumanEvalTemplateCsv-1393080869'; + $expectedResponse = new ConversationModelEvaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setRawHumanEvalTemplateCsv($rawHumanEvalTemplateCsv); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelEvaluationRequest()) + ->setName($name); + $response = $gapicClient->getConversationModelEvaluation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/GetConversationModelEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationModelEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelEvaluationRequest()) + ->setName($name); + try { + $gapicClient->getConversationModelEvaluation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationModelEvaluationsElement = new ConversationModelEvaluation(); + $conversationModelEvaluations = [ + $conversationModelEvaluationsElement, + ]; + $expectedResponse = new ListConversationModelEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationModelEvaluations($conversationModelEvaluations); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelEvaluationsRequest()) + ->setParent($parent); + $response = $gapicClient->listConversationModelEvaluations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationModelEvaluations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/ListConversationModelEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelEvaluationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelEvaluationsRequest()) + ->setParent($parent); + try { + $gapicClient->listConversationModelEvaluations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationModelsElement = new ConversationModel(); + $conversationModels = [ + $conversationModelsElement, + ]; + $expectedResponse = new ListConversationModelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationModels($conversationModels); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelsRequest()) + ->setParent($parent); + $response = $gapicClient->listConversationModels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationModels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/ListConversationModels', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelsRequest()) + ->setParent($parent); + try { + $gapicClient->listConversationModels($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function undeployConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new UndeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->undeployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/UndeployConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new UndeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->undeployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationModelAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + $response = $gapicClient->createConversationModelAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationModel(); + $this->assertProtobufEquals($conversationModel, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php new file mode 100644 index 000000000000..18e39e3e159f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php @@ -0,0 +1,943 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationProfilesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationProfilesClient($options); + } + + /** @test */ + public function clearSuggestionFeatureConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/clearSuggestionFeatureConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $timeZone = 'timeZone36848094'; + $securitySettings = 'securitySettings-595091902'; + $expectedResponse = new ConversationProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setSecuritySettings($securitySettings); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/clearSuggestionFeatureConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationProfile = 'conversationProfile-408626707'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureType = Type::TYPE_UNSPECIFIED; + $request = (new ClearSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + $response = $gapicClient->clearSuggestionFeatureConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/ClearSuggestionFeatureConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $actualValue = $actualApiRequestObject->getParticipantRole(); + $this->assertProtobufEquals($participantRole, $actualValue); + $actualValue = $actualApiRequestObject->getSuggestionFeatureType(); + $this->assertProtobufEquals($suggestionFeatureType, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/clearSuggestionFeatureConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function clearSuggestionFeatureConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/clearSuggestionFeatureConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $conversationProfile = 'conversationProfile-408626707'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureType = Type::TYPE_UNSPECIFIED; + $request = (new ClearSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + $response = $gapicClient->clearSuggestionFeatureConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/clearSuggestionFeatureConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $timeZone = 'timeZone36848094'; + $securitySettings = 'securitySettings-595091902'; + $expectedResponse = new ConversationProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setSecuritySettings($securitySettings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $request = (new CreateConversationProfileRequest()) + ->setParent($formattedParent) + ->setConversationProfile($conversationProfile); + $response = $gapicClient->createConversationProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/CreateConversationProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $request = (new CreateConversationProfileRequest()) + ->setParent($formattedParent) + ->setConversationProfile($conversationProfile); + try { + $gapicClient->createConversationProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConversationProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new DeleteConversationProfileRequest()) + ->setName($formattedName); + $gapicClient->deleteConversationProfile($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/DeleteConversationProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConversationProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new DeleteConversationProfileRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteConversationProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $timeZone = 'timeZone36848094'; + $securitySettings = 'securitySettings-595091902'; + $expectedResponse = new ConversationProfile(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setSecuritySettings($securitySettings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new GetConversationProfileRequest()) + ->setName($formattedName); + $response = $gapicClient->getConversationProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/GetConversationProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new GetConversationProfileRequest()) + ->setName($formattedName); + try { + $gapicClient->getConversationProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationProfilesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationProfilesElement = new ConversationProfile(); + $conversationProfiles = [ + $conversationProfilesElement, + ]; + $expectedResponse = new ListConversationProfilesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationProfiles($conversationProfiles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListConversationProfilesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listConversationProfiles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationProfiles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/ListConversationProfiles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationProfilesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListConversationProfilesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listConversationProfiles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setSuggestionFeatureConfigTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/setSuggestionFeatureConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $timeZone = 'timeZone36848094'; + $securitySettings = 'securitySettings-595091902'; + $expectedResponse = new ConversationProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setSecuritySettings($securitySettings); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/setSuggestionFeatureConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationProfile = 'conversationProfile-408626707'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureConfig = new SuggestionFeatureConfig(); + $request = (new SetSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureConfig($suggestionFeatureConfig); + $response = $gapicClient->setSuggestionFeatureConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/SetSuggestionFeatureConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $actualValue = $actualApiRequestObject->getParticipantRole(); + $this->assertProtobufEquals($participantRole, $actualValue); + $actualValue = $actualApiRequestObject->getSuggestionFeatureConfig(); + $this->assertProtobufEquals($suggestionFeatureConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setSuggestionFeatureConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSuggestionFeatureConfigExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/setSuggestionFeatureConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $conversationProfile = 'conversationProfile-408626707'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureConfig = new SuggestionFeatureConfig(); + $request = (new SetSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureConfig($suggestionFeatureConfig); + $response = $gapicClient->setSuggestionFeatureConfig($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setSuggestionFeatureConfigTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateConversationProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $timeZone = 'timeZone36848094'; + $securitySettings = 'securitySettings-595091902'; + $expectedResponse = new ConversationProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setSecuritySettings($securitySettings); + $transport->addResponse($expectedResponse); + // Mock request + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateConversationProfileRequest()) + ->setConversationProfile($conversationProfile) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateConversationProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/UpdateConversationProfile', $actualFuncCall); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateConversationProfileExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateConversationProfileRequest()) + ->setConversationProfile($conversationProfile) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateConversationProfile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function clearSuggestionFeatureConfigAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/clearSuggestionFeatureConfigTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $timeZone = 'timeZone36848094'; + $securitySettings = 'securitySettings-595091902'; + $expectedResponse = new ConversationProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setSecuritySettings($securitySettings); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/clearSuggestionFeatureConfigTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationProfile = 'conversationProfile-408626707'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureType = Type::TYPE_UNSPECIFIED; + $request = (new ClearSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + $response = $gapicClient->clearSuggestionFeatureConfigAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationProfiles/ClearSuggestionFeatureConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $actualValue = $actualApiRequestObject->getParticipantRole(); + $this->assertProtobufEquals($participantRole, $actualValue); + $actualValue = $actualApiRequestObject->getSuggestionFeatureType(); + $this->assertProtobufEquals($suggestionFeatureType, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/clearSuggestionFeatureConfigTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php new file mode 100644 index 000000000000..6b1de52708f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php @@ -0,0 +1,1033 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationsClient($options); + } + + /** @test */ + public function completeConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + $response = $gapicClient->completeConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CompleteConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function completeConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + try { + $gapicClient->completeConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $conversation = new Conversation(); + $conversationConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $conversation->setConversationProfile($conversationConversationProfile); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + $response = $gapicClient->createConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CreateConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($conversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $conversation = new Conversation(); + $conversationConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $conversation->setConversationProfile($conversationConversationProfile); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + try { + $gapicClient->createConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSuggestionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateStatelessSuggestionResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new GenerateStatelessSuggestionRequest()) + ->setParent($formattedParent); + $response = $gapicClient->generateStatelessSuggestion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateStatelessSuggestion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSuggestionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new GenerateStatelessSuggestionRequest()) + ->setParent($formattedParent); + try { + $gapicClient->generateStatelessSuggestion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSummaryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize = 1116903569; + $expectedResponse = new GenerateStatelessSummaryResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize); + $transport->addResponse($expectedResponse); + // Mock request + $statelessConversation = new MinimalConversation(); + $statelessConversationMessages = []; + $statelessConversation->setMessages($statelessConversationMessages); + $statelessConversationParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $statelessConversation->setParent($statelessConversationParent); + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $request = (new GenerateStatelessSummaryRequest()) + ->setStatelessConversation($statelessConversation) + ->setConversationProfile($conversationProfile); + $response = $gapicClient->generateStatelessSummary($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateStatelessSummary', $actualFuncCall); + $actualValue = $actualRequestObject->getStatelessConversation(); + $this->assertProtobufEquals($statelessConversation, $actualValue); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSummaryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $statelessConversation = new MinimalConversation(); + $statelessConversationMessages = []; + $statelessConversation->setMessages($statelessConversationMessages); + $statelessConversationParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $statelessConversation->setParent($statelessConversationParent); + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $request = (new GenerateStatelessSummaryRequest()) + ->setStatelessConversation($statelessConversation) + ->setConversationProfile($conversationProfile); + try { + $gapicClient->generateStatelessSummary($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateSuggestionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $expectedResponse = new GenerateSuggestionsResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new GenerateSuggestionsRequest()) + ->setConversation($formattedConversation); + $response = $gapicClient->generateSuggestions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateSuggestions', $actualFuncCall); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($formattedConversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateSuggestionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new GenerateSuggestionsRequest()) + ->setConversation($formattedConversation); + try { + $gapicClient->generateSuggestions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new GetConversationRequest()) + ->setName($formattedName); + $response = $gapicClient->getConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GetConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new GetConversationRequest()) + ->setName($formattedName); + try { + $gapicClient->getConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function ingestContextReferencesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new IngestContextReferencesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $contextReferencesValue = new ContextReference(); + $valueContextContents = []; + $contextReferencesValue->setContextContents($valueContextContents); + $valueUpdateMode = UpdateMode::UPDATE_MODE_UNSPECIFIED; + $contextReferencesValue->setUpdateMode($valueUpdateMode); + $contextReferences = [ + 'contextReferencesKey' => $contextReferencesValue, + ]; + $request = (new IngestContextReferencesRequest()) + ->setConversation($formattedConversation) + ->setContextReferences($contextReferences); + $response = $gapicClient->ingestContextReferences($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/IngestContextReferences', $actualFuncCall); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($formattedConversation, $actualValue); + $actualValue = $actualRequestObject->getContextReferences(); + $this->assertProtobufEquals($contextReferences, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function ingestContextReferencesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $contextReferencesValue = new ContextReference(); + $valueContextContents = []; + $contextReferencesValue->setContextContents($valueContextContents); + $valueUpdateMode = UpdateMode::UPDATE_MODE_UNSPECIFIED; + $contextReferencesValue->setUpdateMode($valueUpdateMode); + $contextReferences = [ + 'contextReferencesKey' => $contextReferencesValue, + ]; + $request = (new IngestContextReferencesRequest()) + ->setConversation($formattedConversation) + ->setContextReferences($contextReferences); + try { + $gapicClient->ingestContextReferences($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationsElement = new Conversation(); + $conversations = [ + $conversationsElement, + ]; + $expectedResponse = new ListConversationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversations($conversations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListConversationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listConversations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/ListConversations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListConversationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listConversations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMessagesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $messagesElement = new Message(); + $messages = [ + $messagesElement, + ]; + $expectedResponse = new ListMessagesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMessages($messages); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new ListMessagesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listMessages($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMessages()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/ListMessages', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMessagesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new ListMessagesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listMessages($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchKnowledgeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rewrittenQuery = 'rewrittenQuery-1113584563'; + $expectedResponse = new SearchKnowledgeResponse(); + $expectedResponse->setRewrittenQuery($rewrittenQuery); + $transport->addResponse($expectedResponse); + // Mock request + $query = new TextInput(); + $queryText = 'queryText-1806881259'; + $query->setText($queryText); + $queryLanguageCode = 'queryLanguageCode66898509'; + $query->setLanguageCode($queryLanguageCode); + $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new SearchKnowledgeRequest()) + ->setQuery($query) + ->setConversationProfile($formattedConversationProfile); + $response = $gapicClient->searchKnowledge($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SearchKnowledge', $actualFuncCall); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($formattedConversationProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchKnowledgeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $query = new TextInput(); + $queryText = 'queryText-1806881259'; + $query->setText($queryText); + $queryLanguageCode = 'queryLanguageCode66898509'; + $query->setLanguageCode($queryLanguageCode); + $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new SearchKnowledgeRequest()) + ->setQuery($query) + ->setConversationProfile($formattedConversationProfile); + try { + $gapicClient->searchKnowledge($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestConversationSummaryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestConversationSummaryResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new SuggestConversationSummaryRequest()) + ->setConversation($formattedConversation); + $response = $gapicClient->suggestConversationSummary($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SuggestConversationSummary', $actualFuncCall); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($formattedConversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestConversationSummaryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new SuggestConversationSummaryRequest()) + ->setConversation($formattedConversation); + try { + $gapicClient->suggestConversationSummary($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function completeConversationAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + $response = $gapicClient->completeConversationAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CompleteConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php new file mode 100644 index 000000000000..87682bd0c6cb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php @@ -0,0 +1,1243 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DocumentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DocumentsClient($options); + } + + /** @test */ + public function createDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + $response = $gapicClient->createDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/CreateDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + $response = $gapicClient->createDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new DeleteDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/DeleteDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new DeleteDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ExportDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->exportDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ExportDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ExportDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->exportDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new GetDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->getDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/GetDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new GetDocumentRequest()) + ->setName($formattedName); + try { + $gapicClient->getDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentTemplate = new ImportDocumentTemplate(); + $documentTemplateMimeType = 'documentTemplateMimeType-1300921501'; + $documentTemplate->setMimeType($documentTemplateMimeType); + $documentTemplateKnowledgeTypes = []; + $documentTemplate->setKnowledgeTypes($documentTemplateKnowledgeTypes); + $request = (new ImportDocumentsRequest()) + ->setParent($formattedParent) + ->setDocumentTemplate($documentTemplate); + $response = $gapicClient->importDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ImportDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDocumentTemplate(); + $this->assertProtobufEquals($documentTemplate, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentTemplate = new ImportDocumentTemplate(); + $documentTemplateMimeType = 'documentTemplateMimeType-1300921501'; + $documentTemplate->setMimeType($documentTemplateMimeType); + $documentTemplateKnowledgeTypes = []; + $documentTemplate->setKnowledgeTypes($documentTemplateKnowledgeTypes); + $request = (new ImportDocumentsRequest()) + ->setParent($formattedParent) + ->setDocumentTemplate($documentTemplate); + $response = $gapicClient->importDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $documentsElement = new Document(); + $documents = [ + $documentsElement, + ]; + $expectedResponse = new ListDocumentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDocuments($documents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new ListDocumentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDocuments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDocuments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ListDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new ListDocumentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDocuments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reloadDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reloadDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri2 = 'contentUri218136793'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri2); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/reloadDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ReloadDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->reloadDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ReloadDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reloadDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function reloadDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reloadDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ReloadDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->reloadDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reloadDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new UpdateDocumentRequest()) + ->setDocument($document); + $response = $gapicClient->updateDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/UpdateDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new UpdateDocumentRequest()) + ->setDocument($document); + $response = $gapicClient->updateDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDocumentAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + $response = $gapicClient->createDocumentAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/CreateDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php new file mode 100644 index 000000000000..b9ba0e2171e1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php @@ -0,0 +1,418 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EncryptionSpecServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EncryptionSpecServiceClient($options); + } + + /** @test */ + public function getEncryptionSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest()) + ->setName($formattedName); + $response = $gapicClient->getEncryptionSpec($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest()) + ->setName($formattedName); + try { + $gapicClient->getEncryptionSpec($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new InitializeEncryptionSpecResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/initializeEncryptionSpecTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/InitializeEncryptionSpec', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getEncryptionSpec(); + $this->assertProtobufEquals($encryptionSpec, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest()) + ->setName($formattedName); + $response = $gapicClient->getEncryptionSpecAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php new file mode 100644 index 000000000000..037792a0c294 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php @@ -0,0 +1,1263 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EntityTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EntityTypesClient($options); + } + + /** @test */ + public function batchCreateEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchCreateEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entities = []; + $request = (new BatchCreateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + $response = $gapicClient->batchCreateEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/BatchCreateEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEntities(); + $this->assertProtobufEquals($entities, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchCreateEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchCreateEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entities = []; + $request = (new BatchCreateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + $response = $gapicClient->batchCreateEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchDeleteEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchDeleteEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entityValues = []; + $request = (new BatchDeleteEntitiesRequest()) + ->setParent($formattedParent) + ->setEntityValues($entityValues); + $response = $gapicClient->batchDeleteEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEntityValues(); + $this->assertProtobufEquals($entityValues, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchDeleteEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entityValues = []; + $request = (new BatchDeleteEntitiesRequest()) + ->setParent($formattedParent) + ->setEntityValues($entityValues); + $response = $gapicClient->batchDeleteEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchDeleteEntityTypesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteEntityTypesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchDeleteEntityTypesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $entityTypeNames = []; + $request = (new BatchDeleteEntityTypesRequest()) + ->setParent($formattedParent) + ->setEntityTypeNames($entityTypeNames); + $response = $gapicClient->batchDeleteEntityTypes($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntityTypes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEntityTypeNames(); + $this->assertProtobufEquals($entityTypeNames, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteEntityTypesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchDeleteEntityTypesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteEntityTypesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $entityTypeNames = []; + $request = (new BatchDeleteEntityTypesRequest()) + ->setParent($formattedParent) + ->setEntityTypeNames($entityTypeNames); + $response = $gapicClient->batchDeleteEntityTypes($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteEntityTypesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchUpdateEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchUpdateEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchUpdateEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entities = []; + $request = (new BatchUpdateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + $response = $gapicClient->batchUpdateEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEntities(); + $this->assertProtobufEquals($entities, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchUpdateEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchUpdateEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchUpdateEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entities = []; + $request = (new BatchUpdateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + $response = $gapicClient->batchUpdateEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchUpdateEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchUpdateEntityTypesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchUpdateEntityTypesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchUpdateEntityTypesResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchUpdateEntityTypesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new BatchUpdateEntityTypesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->batchUpdateEntityTypes($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntityTypes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchUpdateEntityTypesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchUpdateEntityTypesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchUpdateEntityTypesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new BatchUpdateEntityTypesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->batchUpdateEntityTypes($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchUpdateEntityTypesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $enableFuzzyExtraction = true; + $expectedResponse = new EntityType(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEnableFuzzyExtraction($enableFuzzyExtraction); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $entityType = new EntityType(); + $entityTypeDisplayName = 'entityTypeDisplayName-441894800'; + $entityType->setDisplayName($entityTypeDisplayName); + $entityTypeKind = Kind::KIND_UNSPECIFIED; + $entityType->setKind($entityTypeKind); + $request = (new CreateEntityTypeRequest()) + ->setParent($formattedParent) + ->setEntityType($entityType); + $response = $gapicClient->createEntityType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/CreateEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEntityType(); + $this->assertProtobufEquals($entityType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $entityType = new EntityType(); + $entityTypeDisplayName = 'entityTypeDisplayName-441894800'; + $entityType->setDisplayName($entityTypeDisplayName); + $entityTypeKind = Kind::KIND_UNSPECIFIED; + $entityType->setKind($entityTypeKind); + $request = (new CreateEntityTypeRequest()) + ->setParent($formattedParent) + ->setEntityType($entityType); + try { + $gapicClient->createEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $request = (new DeleteEntityTypeRequest()) + ->setName($formattedName); + $gapicClient->deleteEntityType($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/DeleteEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $request = (new DeleteEntityTypeRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $enableFuzzyExtraction = true; + $expectedResponse = new EntityType(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEnableFuzzyExtraction($enableFuzzyExtraction); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $request = (new GetEntityTypeRequest()) + ->setName($formattedName); + $response = $gapicClient->getEntityType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/GetEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $request = (new GetEntityTypeRequest()) + ->setName($formattedName); + try { + $gapicClient->getEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEntityTypesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $entityTypesElement = new EntityType(); + $entityTypes = [ + $entityTypesElement, + ]; + $expectedResponse = new ListEntityTypesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEntityTypes($entityTypes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListEntityTypesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listEntityTypes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEntityTypes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/ListEntityTypes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEntityTypesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListEntityTypesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listEntityTypes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $enableFuzzyExtraction = true; + $expectedResponse = new EntityType(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEnableFuzzyExtraction($enableFuzzyExtraction); + $transport->addResponse($expectedResponse); + // Mock request + $entityType = new EntityType(); + $entityTypeDisplayName = 'entityTypeDisplayName-441894800'; + $entityType->setDisplayName($entityTypeDisplayName); + $entityTypeKind = Kind::KIND_UNSPECIFIED; + $entityType->setKind($entityTypeKind); + $request = (new UpdateEntityTypeRequest()) + ->setEntityType($entityType); + $response = $gapicClient->updateEntityType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/UpdateEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getEntityType(); + $this->assertProtobufEquals($entityType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $entityType = new EntityType(); + $entityTypeDisplayName = 'entityTypeDisplayName-441894800'; + $entityType->setDisplayName($entityTypeDisplayName); + $entityTypeKind = Kind::KIND_UNSPECIFIED; + $entityType->setKind($entityTypeKind); + $request = (new UpdateEntityTypeRequest()) + ->setEntityType($entityType); + try { + $gapicClient->updateEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCreateEntitiesAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchCreateEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchCreateEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entities = []; + $request = (new BatchCreateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + $response = $gapicClient->batchCreateEntitiesAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EntityTypes/BatchCreateEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getEntities(); + $this->assertProtobufEquals($entities, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchCreateEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php new file mode 100644 index 000000000000..9a6ccf164384 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php @@ -0,0 +1,670 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EnvironmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EnvironmentsClient($options); + } + + /** @test */ + public function createEnvironmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $agentVersion = 'agentVersion-26267234'; + $expectedResponse = new Environment(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setAgentVersion($agentVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $environment = new Environment(); + $environmentId = 'environmentId608412359'; + $request = (new CreateEnvironmentRequest()) + ->setParent($formattedParent) + ->setEnvironment($environment) + ->setEnvironmentId($environmentId); + $response = $gapicClient->createEnvironment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/CreateEnvironment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEnvironment(); + $this->assertProtobufEquals($environment, $actualValue); + $actualValue = $actualRequestObject->getEnvironmentId(); + $this->assertProtobufEquals($environmentId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEnvironmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $environment = new Environment(); + $environmentId = 'environmentId608412359'; + $request = (new CreateEnvironmentRequest()) + ->setParent($formattedParent) + ->setEnvironment($environment) + ->setEnvironmentId($environmentId); + try { + $gapicClient->createEnvironment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEnvironmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + $request = (new DeleteEnvironmentRequest()) + ->setName($formattedName); + $gapicClient->deleteEnvironment($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/DeleteEnvironment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteEnvironmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + $request = (new DeleteEnvironmentRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteEnvironment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEnvironmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $agentVersion = 'agentVersion-26267234'; + $expectedResponse = new Environment(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setAgentVersion($agentVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + $request = (new GetEnvironmentRequest()) + ->setName($formattedName); + $response = $gapicClient->getEnvironment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/GetEnvironment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEnvironmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + $request = (new GetEnvironmentRequest()) + ->setName($formattedName); + try { + $gapicClient->getEnvironment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEnvironmentHistoryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $parent2 = 'parent21175163357'; + $nextPageToken = ''; + $entriesElement = new Entry(); + $entries = [ + $entriesElement, + ]; + $expectedResponse = new EnvironmentHistory(); + $expectedResponse->setParent($parent2); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEntries($entries); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + $request = (new GetEnvironmentHistoryRequest()) + ->setParent($formattedParent); + $response = $gapicClient->getEnvironmentHistory($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEntries()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/GetEnvironmentHistory', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEnvironmentHistoryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + $request = (new GetEnvironmentHistoryRequest()) + ->setParent($formattedParent); + try { + $gapicClient->getEnvironmentHistory($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEnvironmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $environmentsElement = new Environment(); + $environments = [ + $environmentsElement, + ]; + $expectedResponse = new ListEnvironmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEnvironments($environments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListEnvironmentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listEnvironments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEnvironments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/ListEnvironments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEnvironmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListEnvironmentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listEnvironments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEnvironmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $agentVersion = 'agentVersion-26267234'; + $expectedResponse = new Environment(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setAgentVersion($agentVersion); + $transport->addResponse($expectedResponse); + // Mock request + $environment = new Environment(); + $updateMask = new FieldMask(); + $request = (new UpdateEnvironmentRequest()) + ->setEnvironment($environment) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEnvironment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/UpdateEnvironment', $actualFuncCall); + $actualValue = $actualRequestObject->getEnvironment(); + $this->assertProtobufEquals($environment, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEnvironmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $environment = new Environment(); + $updateMask = new FieldMask(); + $request = (new UpdateEnvironmentRequest()) + ->setEnvironment($environment) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateEnvironment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEnvironmentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $agentVersion = 'agentVersion-26267234'; + $expectedResponse = new Environment(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setAgentVersion($agentVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $environment = new Environment(); + $environmentId = 'environmentId608412359'; + $request = (new CreateEnvironmentRequest()) + ->setParent($formattedParent) + ->setEnvironment($environment) + ->setEnvironmentId($environmentId); + $response = $gapicClient->createEnvironmentAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Environments/CreateEnvironment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEnvironment(); + $this->assertProtobufEquals($environment, $actualValue); + $actualValue = $actualRequestObject->getEnvironmentId(); + $this->assertProtobufEquals($environmentId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php new file mode 100644 index 000000000000..ae9f1786a49c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php @@ -0,0 +1,371 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FulfillmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FulfillmentsClient($options); + } + + /** @test */ + public function getFulfillmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $enabled = false; + $expectedResponse = new Fulfillment(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEnabled($enabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->fulfillmentName('[PROJECT]'); + $request = (new GetFulfillmentRequest()) + ->setName($formattedName); + $response = $gapicClient->getFulfillment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Fulfillments/GetFulfillment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFulfillmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->fulfillmentName('[PROJECT]'); + $request = (new GetFulfillmentRequest()) + ->setName($formattedName); + try { + $gapicClient->getFulfillment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFulfillmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $enabled = false; + $expectedResponse = new Fulfillment(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEnabled($enabled); + $transport->addResponse($expectedResponse); + // Mock request + $fulfillment = new Fulfillment(); + $fulfillmentName = 'fulfillmentName1097998729'; + $fulfillment->setName($fulfillmentName); + $updateMask = new FieldMask(); + $request = (new UpdateFulfillmentRequest()) + ->setFulfillment($fulfillment) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateFulfillment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Fulfillments/UpdateFulfillment', $actualFuncCall); + $actualValue = $actualRequestObject->getFulfillment(); + $this->assertProtobufEquals($fulfillment, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFulfillmentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $fulfillment = new Fulfillment(); + $fulfillmentName = 'fulfillmentName1097998729'; + $fulfillment->setName($fulfillmentName); + $updateMask = new FieldMask(); + $request = (new UpdateFulfillmentRequest()) + ->setFulfillment($fulfillment) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateFulfillment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFulfillmentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $enabled = false; + $expectedResponse = new Fulfillment(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEnabled($enabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->fulfillmentName('[PROJECT]'); + $request = (new GetFulfillmentRequest()) + ->setName($formattedName); + $response = $gapicClient->getFulfillmentAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Fulfillments/GetFulfillment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorEvaluationsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorEvaluationsClientTest.php new file mode 100644 index 000000000000..0a3a9c4a2343 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorEvaluationsClientTest.php @@ -0,0 +1,647 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GeneratorEvaluationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GeneratorEvaluationsClient($options); + } + + /** @test */ + public function createGeneratorEvaluationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGeneratorEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new GeneratorEvaluation(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGeneratorEvaluationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $generatorEvaluation = new GeneratorEvaluation(); + $generatorEvaluationGeneratorEvaluationConfig = new GeneratorEvaluationConfig(); + $generatorEvaluationConfigInputDataConfig = new InputDataConfig(); + $inputDataConfigInputDataSourceType = InputDataSourceType::INPUT_DATA_SOURCE_TYPE_UNSPECIFIED; + $generatorEvaluationConfigInputDataConfig->setInputDataSourceType($inputDataConfigInputDataSourceType); + $generatorEvaluationGeneratorEvaluationConfig->setInputDataConfig($generatorEvaluationConfigInputDataConfig); + $generatorEvaluationConfigOutputGcsBucketPath = 'generatorEvaluationConfigOutputGcsBucketPath1105025492'; + $generatorEvaluationGeneratorEvaluationConfig->setOutputGcsBucketPath($generatorEvaluationConfigOutputGcsBucketPath); + $generatorEvaluation->setGeneratorEvaluationConfig($generatorEvaluationGeneratorEvaluationConfig); + $generatorEvaluationInitialGenerator = new Generator(); + $generatorEvaluation->setInitialGenerator($generatorEvaluationInitialGenerator); + $request = (new CreateGeneratorEvaluationRequest()) + ->setParent($formattedParent) + ->setGeneratorEvaluation($generatorEvaluation); + $response = $gapicClient->createGeneratorEvaluation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.GeneratorEvaluations/CreateGeneratorEvaluation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGeneratorEvaluation(); + $this->assertProtobufEquals($generatorEvaluation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGeneratorEvaluationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGeneratorEvaluationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGeneratorEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $generatorEvaluation = new GeneratorEvaluation(); + $generatorEvaluationGeneratorEvaluationConfig = new GeneratorEvaluationConfig(); + $generatorEvaluationConfigInputDataConfig = new InputDataConfig(); + $inputDataConfigInputDataSourceType = InputDataSourceType::INPUT_DATA_SOURCE_TYPE_UNSPECIFIED; + $generatorEvaluationConfigInputDataConfig->setInputDataSourceType($inputDataConfigInputDataSourceType); + $generatorEvaluationGeneratorEvaluationConfig->setInputDataConfig($generatorEvaluationConfigInputDataConfig); + $generatorEvaluationConfigOutputGcsBucketPath = 'generatorEvaluationConfigOutputGcsBucketPath1105025492'; + $generatorEvaluationGeneratorEvaluationConfig->setOutputGcsBucketPath($generatorEvaluationConfigOutputGcsBucketPath); + $generatorEvaluation->setGeneratorEvaluationConfig($generatorEvaluationGeneratorEvaluationConfig); + $generatorEvaluationInitialGenerator = new Generator(); + $generatorEvaluation->setInitialGenerator($generatorEvaluationInitialGenerator); + $request = (new CreateGeneratorEvaluationRequest()) + ->setParent($formattedParent) + ->setGeneratorEvaluation($generatorEvaluation); + $response = $gapicClient->createGeneratorEvaluation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGeneratorEvaluationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorEvaluationName('[PROJECT]', '[LOCATION]', '[GENERATOR]', '[EVALUATION]'); + $request = (new DeleteGeneratorEvaluationRequest()) + ->setName($formattedName); + $gapicClient->deleteGeneratorEvaluation($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.GeneratorEvaluations/DeleteGeneratorEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorEvaluationName('[PROJECT]', '[LOCATION]', '[GENERATOR]', '[EVALUATION]'); + $request = (new DeleteGeneratorEvaluationRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteGeneratorEvaluation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new GeneratorEvaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorEvaluationName('[PROJECT]', '[LOCATION]', '[GENERATOR]', '[EVALUATION]'); + $request = (new GetGeneratorEvaluationRequest()) + ->setName($formattedName); + $response = $gapicClient->getGeneratorEvaluation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.GeneratorEvaluations/GetGeneratorEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorEvaluationName('[PROJECT]', '[LOCATION]', '[GENERATOR]', '[EVALUATION]'); + $request = (new GetGeneratorEvaluationRequest()) + ->setName($formattedName); + try { + $gapicClient->getGeneratorEvaluation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $generatorEvaluationsElement = new GeneratorEvaluation(); + $generatorEvaluations = [ + $generatorEvaluationsElement, + ]; + $expectedResponse = new ListGeneratorEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGeneratorEvaluations($generatorEvaluations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new ListGeneratorEvaluationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listGeneratorEvaluations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGeneratorEvaluations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.GeneratorEvaluations/ListGeneratorEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorEvaluationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new ListGeneratorEvaluationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listGeneratorEvaluations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGeneratorEvaluationAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGeneratorEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new GeneratorEvaluation(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGeneratorEvaluationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $generatorEvaluation = new GeneratorEvaluation(); + $generatorEvaluationGeneratorEvaluationConfig = new GeneratorEvaluationConfig(); + $generatorEvaluationConfigInputDataConfig = new InputDataConfig(); + $inputDataConfigInputDataSourceType = InputDataSourceType::INPUT_DATA_SOURCE_TYPE_UNSPECIFIED; + $generatorEvaluationConfigInputDataConfig->setInputDataSourceType($inputDataConfigInputDataSourceType); + $generatorEvaluationGeneratorEvaluationConfig->setInputDataConfig($generatorEvaluationConfigInputDataConfig); + $generatorEvaluationConfigOutputGcsBucketPath = 'generatorEvaluationConfigOutputGcsBucketPath1105025492'; + $generatorEvaluationGeneratorEvaluationConfig->setOutputGcsBucketPath($generatorEvaluationConfigOutputGcsBucketPath); + $generatorEvaluation->setGeneratorEvaluationConfig($generatorEvaluationGeneratorEvaluationConfig); + $generatorEvaluationInitialGenerator = new Generator(); + $generatorEvaluation->setInitialGenerator($generatorEvaluationInitialGenerator); + $request = (new CreateGeneratorEvaluationRequest()) + ->setParent($formattedParent) + ->setGeneratorEvaluation($generatorEvaluation); + $response = $gapicClient->createGeneratorEvaluationAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.GeneratorEvaluations/CreateGeneratorEvaluation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGeneratorEvaluation(); + $this->assertProtobufEquals($generatorEvaluation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGeneratorEvaluationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php new file mode 100644 index 000000000000..cf879c83e287 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php @@ -0,0 +1,576 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GeneratorsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GeneratorsClient($options); + } + + /** @test */ + public function createGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $publishedModel = 'publishedModel1881429400'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPublishedModel($publishedModel); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + $response = $gapicClient->createGenerator($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + try { + $gapicClient->createGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new DeleteGeneratorRequest()) + ->setName($formattedName); + $gapicClient->deleteGenerator($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/DeleteGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new DeleteGeneratorRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $publishedModel = 'publishedModel1881429400'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setPublishedModel($publishedModel); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new GetGeneratorRequest()) + ->setName($formattedName); + $response = $gapicClient->getGenerator($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/GetGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new GetGeneratorRequest()) + ->setName($formattedName); + try { + $gapicClient->getGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $generatorsElement = new Generator(); + $generators = [ + $generatorsElement, + ]; + $expectedResponse = new ListGeneratorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGenerators($generators); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListGeneratorsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listGenerators($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGenerators()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/ListGenerators', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListGeneratorsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listGenerators($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $publishedModel = 'publishedModel1881429400'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPublishedModel($publishedModel); + $transport->addResponse($expectedResponse); + // Mock request + $generator = new Generator(); + $request = (new UpdateGeneratorRequest()) + ->setGenerator($generator); + $response = $gapicClient->updateGenerator($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/UpdateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $generator = new Generator(); + $request = (new UpdateGeneratorRequest()) + ->setGenerator($generator); + try { + $gapicClient->updateGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGeneratorAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $publishedModel = 'publishedModel1881429400'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setPublishedModel($publishedModel); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + $response = $gapicClient->createGeneratorAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php new file mode 100644 index 000000000000..c1ffeb8592ef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php @@ -0,0 +1,918 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return IntentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new IntentsClient($options); + } + + /** @test */ + public function batchDeleteIntentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteIntentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchDeleteIntentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $intents = []; + $request = (new BatchDeleteIntentsRequest()) + ->setParent($formattedParent) + ->setIntents($intents); + $response = $gapicClient->batchDeleteIntents($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/BatchDeleteIntents', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getIntents(); + $this->assertProtobufEquals($intents, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteIntentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchDeleteIntentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteIntentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $intents = []; + $request = (new BatchDeleteIntentsRequest()) + ->setParent($formattedParent) + ->setIntents($intents); + $response = $gapicClient->batchDeleteIntents($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteIntentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchUpdateIntentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchUpdateIntentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchUpdateIntentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchUpdateIntentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new BatchUpdateIntentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->batchUpdateIntents($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/BatchUpdateIntents', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchUpdateIntentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchUpdateIntentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchUpdateIntentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new BatchUpdateIntentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->batchUpdateIntents($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchUpdateIntentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIntentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $priority = 1165461084; + $isFallback = false; + $mlDisabled = true; + $liveAgentHandoff = false; + $endInteraction = true; + $action = 'action-1422950858'; + $resetContexts = true; + $rootFollowupIntentName = 'rootFollowupIntentName402253784'; + $parentFollowupIntentName = 'parentFollowupIntentName-1131901680'; + $expectedResponse = new Intent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setPriority($priority); + $expectedResponse->setIsFallback($isFallback); + $expectedResponse->setMlDisabled($mlDisabled); + $expectedResponse->setLiveAgentHandoff($liveAgentHandoff); + $expectedResponse->setEndInteraction($endInteraction); + $expectedResponse->setAction($action); + $expectedResponse->setResetContexts($resetContexts); + $expectedResponse->setRootFollowupIntentName($rootFollowupIntentName); + $expectedResponse->setParentFollowupIntentName($parentFollowupIntentName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $intent = new Intent(); + $intentDisplayName = 'intentDisplayName-1733865935'; + $intent->setDisplayName($intentDisplayName); + $request = (new CreateIntentRequest()) + ->setParent($formattedParent) + ->setIntent($intent); + $response = $gapicClient->createIntent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/CreateIntent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getIntent(); + $this->assertProtobufEquals($intent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createIntentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $intent = new Intent(); + $intentDisplayName = 'intentDisplayName-1733865935'; + $intent->setDisplayName($intentDisplayName); + $request = (new CreateIntentRequest()) + ->setParent($formattedParent) + ->setIntent($intent); + try { + $gapicClient->createIntent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteIntentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->intentName('[PROJECT]', '[INTENT]'); + $request = (new DeleteIntentRequest()) + ->setName($formattedName); + $gapicClient->deleteIntent($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/DeleteIntent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteIntentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->intentName('[PROJECT]', '[INTENT]'); + $request = (new DeleteIntentRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteIntent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIntentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $priority = 1165461084; + $isFallback = false; + $mlDisabled = true; + $liveAgentHandoff = false; + $endInteraction = true; + $action = 'action-1422950858'; + $resetContexts = true; + $rootFollowupIntentName = 'rootFollowupIntentName402253784'; + $parentFollowupIntentName = 'parentFollowupIntentName-1131901680'; + $expectedResponse = new Intent(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setPriority($priority); + $expectedResponse->setIsFallback($isFallback); + $expectedResponse->setMlDisabled($mlDisabled); + $expectedResponse->setLiveAgentHandoff($liveAgentHandoff); + $expectedResponse->setEndInteraction($endInteraction); + $expectedResponse->setAction($action); + $expectedResponse->setResetContexts($resetContexts); + $expectedResponse->setRootFollowupIntentName($rootFollowupIntentName); + $expectedResponse->setParentFollowupIntentName($parentFollowupIntentName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->intentName('[PROJECT]', '[INTENT]'); + $request = (new GetIntentRequest()) + ->setName($formattedName); + $response = $gapicClient->getIntent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/GetIntent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIntentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->intentName('[PROJECT]', '[INTENT]'); + $request = (new GetIntentRequest()) + ->setName($formattedName); + try { + $gapicClient->getIntent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIntentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $intentsElement = new Intent(); + $intents = [ + $intentsElement, + ]; + $expectedResponse = new ListIntentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIntents($intents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListIntentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listIntents($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIntents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/ListIntents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIntentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListIntentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listIntents($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateIntentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $priority = 1165461084; + $isFallback = false; + $mlDisabled = true; + $liveAgentHandoff = false; + $endInteraction = true; + $action = 'action-1422950858'; + $resetContexts = true; + $rootFollowupIntentName = 'rootFollowupIntentName402253784'; + $parentFollowupIntentName = 'parentFollowupIntentName-1131901680'; + $expectedResponse = new Intent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setPriority($priority); + $expectedResponse->setIsFallback($isFallback); + $expectedResponse->setMlDisabled($mlDisabled); + $expectedResponse->setLiveAgentHandoff($liveAgentHandoff); + $expectedResponse->setEndInteraction($endInteraction); + $expectedResponse->setAction($action); + $expectedResponse->setResetContexts($resetContexts); + $expectedResponse->setRootFollowupIntentName($rootFollowupIntentName); + $expectedResponse->setParentFollowupIntentName($parentFollowupIntentName); + $transport->addResponse($expectedResponse); + // Mock request + $intent = new Intent(); + $intentDisplayName = 'intentDisplayName-1733865935'; + $intent->setDisplayName($intentDisplayName); + $request = (new UpdateIntentRequest()) + ->setIntent($intent); + $response = $gapicClient->updateIntent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/UpdateIntent', $actualFuncCall); + $actualValue = $actualRequestObject->getIntent(); + $this->assertProtobufEquals($intent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateIntentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $intent = new Intent(); + $intentDisplayName = 'intentDisplayName-1733865935'; + $intent->setDisplayName($intentDisplayName); + $request = (new UpdateIntentRequest()) + ->setIntent($intent); + try { + $gapicClient->updateIntent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchDeleteIntentsAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchDeleteIntentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchDeleteIntentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $intents = []; + $request = (new BatchDeleteIntentsRequest()) + ->setParent($formattedParent) + ->setIntents($intents); + $response = $gapicClient->batchDeleteIntentsAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Intents/BatchDeleteIntents', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getIntents(); + $this->assertProtobufEquals($intents, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchDeleteIntentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php new file mode 100644 index 000000000000..6f42a671a5da --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php @@ -0,0 +1,586 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return KnowledgeBasesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new KnowledgeBasesClient($options); + } + + /** @test */ + public function createKnowledgeBaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new KnowledgeBase(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $knowledgeBase = new KnowledgeBase(); + $knowledgeBaseDisplayName = 'knowledgeBaseDisplayName881802878'; + $knowledgeBase->setDisplayName($knowledgeBaseDisplayName); + $request = (new CreateKnowledgeBaseRequest()) + ->setParent($formattedParent) + ->setKnowledgeBase($knowledgeBase); + $response = $gapicClient->createKnowledgeBase($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.KnowledgeBases/CreateKnowledgeBase', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getKnowledgeBase(); + $this->assertProtobufEquals($knowledgeBase, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKnowledgeBaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $knowledgeBase = new KnowledgeBase(); + $knowledgeBaseDisplayName = 'knowledgeBaseDisplayName881802878'; + $knowledgeBase->setDisplayName($knowledgeBaseDisplayName); + $request = (new CreateKnowledgeBaseRequest()) + ->setParent($formattedParent) + ->setKnowledgeBase($knowledgeBase); + try { + $gapicClient->createKnowledgeBase($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteKnowledgeBaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new DeleteKnowledgeBaseRequest()) + ->setName($formattedName); + $gapicClient->deleteKnowledgeBase($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.KnowledgeBases/DeleteKnowledgeBase', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteKnowledgeBaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new DeleteKnowledgeBaseRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteKnowledgeBase($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKnowledgeBaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new KnowledgeBase(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new GetKnowledgeBaseRequest()) + ->setName($formattedName); + $response = $gapicClient->getKnowledgeBase($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.KnowledgeBases/GetKnowledgeBase', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKnowledgeBaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new GetKnowledgeBaseRequest()) + ->setName($formattedName); + try { + $gapicClient->getKnowledgeBase($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKnowledgeBasesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $knowledgeBasesElement = new KnowledgeBase(); + $knowledgeBases = [ + $knowledgeBasesElement, + ]; + $expectedResponse = new ListKnowledgeBasesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setKnowledgeBases($knowledgeBases); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListKnowledgeBasesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listKnowledgeBases($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getKnowledgeBases()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.KnowledgeBases/ListKnowledgeBases', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKnowledgeBasesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListKnowledgeBasesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listKnowledgeBases($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateKnowledgeBaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new KnowledgeBase(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $knowledgeBase = new KnowledgeBase(); + $knowledgeBaseDisplayName = 'knowledgeBaseDisplayName881802878'; + $knowledgeBase->setDisplayName($knowledgeBaseDisplayName); + $request = (new UpdateKnowledgeBaseRequest()) + ->setKnowledgeBase($knowledgeBase); + $response = $gapicClient->updateKnowledgeBase($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.KnowledgeBases/UpdateKnowledgeBase', $actualFuncCall); + $actualValue = $actualRequestObject->getKnowledgeBase(); + $this->assertProtobufEquals($knowledgeBase, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateKnowledgeBaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $knowledgeBase = new KnowledgeBase(); + $knowledgeBaseDisplayName = 'knowledgeBaseDisplayName881802878'; + $knowledgeBase->setDisplayName($knowledgeBaseDisplayName); + $request = (new UpdateKnowledgeBaseRequest()) + ->setKnowledgeBase($knowledgeBase); + try { + $gapicClient->updateKnowledgeBase($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKnowledgeBaseAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $expectedResponse = new KnowledgeBase(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $knowledgeBase = new KnowledgeBase(); + $knowledgeBaseDisplayName = 'knowledgeBaseDisplayName881802878'; + $knowledgeBase->setDisplayName($knowledgeBaseDisplayName); + $request = (new CreateKnowledgeBaseRequest()) + ->setParent($formattedParent) + ->setKnowledgeBase($knowledgeBase); + $response = $gapicClient->createKnowledgeBaseAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.KnowledgeBases/CreateKnowledgeBase', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getKnowledgeBase(); + $this->assertProtobufEquals($knowledgeBase, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php new file mode 100644 index 000000000000..1c2c2df91d55 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php @@ -0,0 +1,959 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ParticipantsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ParticipantsClient($options); + } + + /** @test */ + public function analyzeContentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $replyText = 'replyText-549180062'; + $expectedResponse = new AnalyzeContentResponse(); + $expectedResponse->setReplyText($replyText); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParticipant = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new AnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + $response = $gapicClient->analyzeContent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/AnalyzeContent', $actualFuncCall); + $actualValue = $actualRequestObject->getParticipant(); + $this->assertProtobufEquals($formattedParticipant, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeContentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParticipant = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new AnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + try { + $gapicClient->analyzeContent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createParticipantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $sipRecordingMediaLabel = 'sipRecordingMediaLabel-1522741274'; + $obfuscatedExternalUserId = 'obfuscatedExternalUserId-263618122'; + $expectedResponse = new Participant(); + $expectedResponse->setName($name); + $expectedResponse->setSipRecordingMediaLabel($sipRecordingMediaLabel); + $expectedResponse->setObfuscatedExternalUserId($obfuscatedExternalUserId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $participant = new Participant(); + $request = (new CreateParticipantRequest()) + ->setParent($formattedParent) + ->setParticipant($participant); + $response = $gapicClient->createParticipant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/CreateParticipant', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getParticipant(); + $this->assertProtobufEquals($participant, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createParticipantExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $participant = new Participant(); + $request = (new CreateParticipantRequest()) + ->setParent($formattedParent) + ->setParticipant($participant); + try { + $gapicClient->createParticipant($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getParticipantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $sipRecordingMediaLabel = 'sipRecordingMediaLabel-1522741274'; + $obfuscatedExternalUserId = 'obfuscatedExternalUserId-263618122'; + $expectedResponse = new Participant(); + $expectedResponse->setName($name2); + $expectedResponse->setSipRecordingMediaLabel($sipRecordingMediaLabel); + $expectedResponse->setObfuscatedExternalUserId($obfuscatedExternalUserId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new GetParticipantRequest()) + ->setName($formattedName); + $response = $gapicClient->getParticipant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/GetParticipant', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getParticipantExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new GetParticipantRequest()) + ->setName($formattedName); + try { + $gapicClient->getParticipant($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listParticipantsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $participantsElement = new Participant(); + $participants = [ + $participantsElement, + ]; + $expectedResponse = new ListParticipantsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setParticipants($participants); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new ListParticipantsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listParticipants($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getParticipants()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/ListParticipants', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listParticipantsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new ListParticipantsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listParticipants($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingAnalyzeContentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $replyText = 'replyText-549180062'; + $speechModel = 'speechModel-893274740'; + $expectedResponse = new StreamingAnalyzeContentResponse(); + $expectedResponse->setReplyText($replyText); + $expectedResponse->setSpeechModel($speechModel); + $transport->addResponse($expectedResponse); + $replyText2 = 'replyText2518940821'; + $speechModel2 = 'speechModel2556437055'; + $expectedResponse2 = new StreamingAnalyzeContentResponse(); + $expectedResponse2->setReplyText($replyText2); + $expectedResponse2->setSpeechModel($speechModel2); + $transport->addResponse($expectedResponse2); + $replyText3 = 'replyText3518940822'; + $speechModel3 = 'speechModel3556437056'; + $expectedResponse3 = new StreamingAnalyzeContentResponse(); + $expectedResponse3->setReplyText($replyText3); + $expectedResponse3->setSpeechModel($speechModel3); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedParticipant = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = new StreamingAnalyzeContentRequest(); + $request->setParticipant($formattedParticipant); + $formattedParticipant2 = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request2 = new StreamingAnalyzeContentRequest(); + $request2->setParticipant($formattedParticipant2); + $formattedParticipant3 = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request3 = new StreamingAnalyzeContentRequest(); + $request3->setParticipant($formattedParticipant3); + $bidi = $gapicClient->streamingAnalyzeContent(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/StreamingAnalyzeContent', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingAnalyzeContentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamingAnalyzeContent(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestArticlesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestArticlesResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestArticlesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->suggestArticles($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestArticles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestArticlesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestArticlesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->suggestArticles($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestFaqAnswersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestFaqAnswersResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestFaqAnswersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->suggestFaqAnswers($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestFaqAnswers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestFaqAnswersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestFaqAnswersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->suggestFaqAnswers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestKnowledgeAssistTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestKnowledgeAssistResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestKnowledgeAssistRequest()) + ->setParent($formattedParent); + $response = $gapicClient->suggestKnowledgeAssist($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestKnowledgeAssist', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestKnowledgeAssistExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestKnowledgeAssistRequest()) + ->setParent($formattedParent); + try { + $gapicClient->suggestKnowledgeAssist($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestSmartRepliesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestSmartRepliesResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestSmartRepliesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->suggestSmartReplies($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestSmartReplies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestSmartRepliesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestSmartRepliesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->suggestSmartReplies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateParticipantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $sipRecordingMediaLabel = 'sipRecordingMediaLabel-1522741274'; + $obfuscatedExternalUserId = 'obfuscatedExternalUserId-263618122'; + $expectedResponse = new Participant(); + $expectedResponse->setName($name); + $expectedResponse->setSipRecordingMediaLabel($sipRecordingMediaLabel); + $expectedResponse->setObfuscatedExternalUserId($obfuscatedExternalUserId); + $transport->addResponse($expectedResponse); + // Mock request + $participant = new Participant(); + $updateMask = new FieldMask(); + $request = (new UpdateParticipantRequest()) + ->setParticipant($participant) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateParticipant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/UpdateParticipant', $actualFuncCall); + $actualValue = $actualRequestObject->getParticipant(); + $this->assertProtobufEquals($participant, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateParticipantExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $participant = new Participant(); + $updateMask = new FieldMask(); + $request = (new UpdateParticipantRequest()) + ->setParticipant($participant) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateParticipant($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeContentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $replyText = 'replyText-549180062'; + $expectedResponse = new AnalyzeContentResponse(); + $expectedResponse->setReplyText($replyText); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParticipant = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new AnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + $response = $gapicClient->analyzeContentAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/AnalyzeContent', $actualFuncCall); + $actualValue = $actualRequestObject->getParticipant(); + $this->assertProtobufEquals($formattedParticipant, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php new file mode 100644 index 000000000000..effcf214be69 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php @@ -0,0 +1,591 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SessionEntityTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SessionEntityTypesClient($options); + } + + /** @test */ + public function createSessionEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new SessionEntityType(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $sessionEntityType = new SessionEntityType(); + $sessionEntityTypeName = 'sessionEntityTypeName-916646370'; + $sessionEntityType->setName($sessionEntityTypeName); + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityType->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode); + $sessionEntityTypeEntities = []; + $sessionEntityType->setEntities($sessionEntityTypeEntities); + $request = (new CreateSessionEntityTypeRequest()) + ->setParent($formattedParent) + ->setSessionEntityType($sessionEntityType); + $response = $gapicClient->createSessionEntityType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SessionEntityTypes/CreateSessionEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSessionEntityType(); + $this->assertProtobufEquals($sessionEntityType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSessionEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $sessionEntityType = new SessionEntityType(); + $sessionEntityTypeName = 'sessionEntityTypeName-916646370'; + $sessionEntityType->setName($sessionEntityTypeName); + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityType->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode); + $sessionEntityTypeEntities = []; + $sessionEntityType->setEntities($sessionEntityTypeEntities); + $request = (new CreateSessionEntityTypeRequest()) + ->setParent($formattedParent) + ->setSessionEntityType($sessionEntityType); + try { + $gapicClient->createSessionEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSessionEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); + $request = (new DeleteSessionEntityTypeRequest()) + ->setName($formattedName); + $gapicClient->deleteSessionEntityType($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SessionEntityTypes/DeleteSessionEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSessionEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); + $request = (new DeleteSessionEntityTypeRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteSessionEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSessionEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new SessionEntityType(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); + $request = (new GetSessionEntityTypeRequest()) + ->setName($formattedName); + $response = $gapicClient->getSessionEntityType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SessionEntityTypes/GetSessionEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSessionEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); + $request = (new GetSessionEntityTypeRequest()) + ->setName($formattedName); + try { + $gapicClient->getSessionEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSessionEntityTypesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sessionEntityTypesElement = new SessionEntityType(); + $sessionEntityTypes = [ + $sessionEntityTypesElement, + ]; + $expectedResponse = new ListSessionEntityTypesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSessionEntityTypes($sessionEntityTypes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $request = (new ListSessionEntityTypesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSessionEntityTypes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSessionEntityTypes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SessionEntityTypes/ListSessionEntityTypes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSessionEntityTypesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $request = (new ListSessionEntityTypesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSessionEntityTypes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSessionEntityTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new SessionEntityType(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $sessionEntityType = new SessionEntityType(); + $sessionEntityTypeName = 'sessionEntityTypeName-916646370'; + $sessionEntityType->setName($sessionEntityTypeName); + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityType->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode); + $sessionEntityTypeEntities = []; + $sessionEntityType->setEntities($sessionEntityTypeEntities); + $request = (new UpdateSessionEntityTypeRequest()) + ->setSessionEntityType($sessionEntityType); + $response = $gapicClient->updateSessionEntityType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SessionEntityTypes/UpdateSessionEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getSessionEntityType(); + $this->assertProtobufEquals($sessionEntityType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSessionEntityTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $sessionEntityType = new SessionEntityType(); + $sessionEntityTypeName = 'sessionEntityTypeName-916646370'; + $sessionEntityType->setName($sessionEntityTypeName); + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityType->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode); + $sessionEntityTypeEntities = []; + $sessionEntityType->setEntities($sessionEntityTypeEntities); + $request = (new UpdateSessionEntityTypeRequest()) + ->setSessionEntityType($sessionEntityType); + try { + $gapicClient->updateSessionEntityType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSessionEntityTypeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new SessionEntityType(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $sessionEntityType = new SessionEntityType(); + $sessionEntityTypeName = 'sessionEntityTypeName-916646370'; + $sessionEntityType->setName($sessionEntityTypeName); + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityType->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode); + $sessionEntityTypeEntities = []; + $sessionEntityType->setEntities($sessionEntityTypeEntities); + $request = (new CreateSessionEntityTypeRequest()) + ->setParent($formattedParent) + ->setSessionEntityType($sessionEntityType); + $response = $gapicClient->createSessionEntityTypeAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SessionEntityTypes/CreateSessionEntityType', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSessionEntityType(); + $this->assertProtobufEquals($sessionEntityType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php new file mode 100644 index 000000000000..bb2914cac65a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php @@ -0,0 +1,413 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SessionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SessionsClient($options); + } + + /** @test */ + public function detectIntentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $responseId = 'responseId1847552473'; + $outputAudio = '24'; + $expectedResponse = new DetectIntentResponse(); + $expectedResponse->setResponseId($responseId); + $expectedResponse->setOutputAudio($outputAudio); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSession = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $queryInput = new QueryInput(); + $request = (new DetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + $response = $gapicClient->detectIntent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Sessions/DetectIntent', $actualFuncCall); + $actualValue = $actualRequestObject->getSession(); + $this->assertProtobufEquals($formattedSession, $actualValue); + $actualValue = $actualRequestObject->getQueryInput(); + $this->assertProtobufEquals($queryInput, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function detectIntentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedSession = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $queryInput = new QueryInput(); + $request = (new DetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + try { + $gapicClient->detectIntent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingDetectIntentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $responseId = 'responseId1847552473'; + $outputAudio = '24'; + $expectedResponse = new StreamingDetectIntentResponse(); + $expectedResponse->setResponseId($responseId); + $expectedResponse->setOutputAudio($outputAudio); + $transport->addResponse($expectedResponse); + $responseId2 = 'responseId21676436300'; + $outputAudio2 = '-53'; + $expectedResponse2 = new StreamingDetectIntentResponse(); + $expectedResponse2->setResponseId($responseId2); + $expectedResponse2->setOutputAudio($outputAudio2); + $transport->addResponse($expectedResponse2); + $responseId3 = 'responseId31676436301'; + $outputAudio3 = '-52'; + $expectedResponse3 = new StreamingDetectIntentResponse(); + $expectedResponse3->setResponseId($responseId3); + $expectedResponse3->setOutputAudio($outputAudio3); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedSession = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $queryInput = new QueryInput(); + $request = new StreamingDetectIntentRequest(); + $request->setSession($formattedSession); + $request->setQueryInput($queryInput); + $formattedSession2 = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $queryInput2 = new QueryInput(); + $request2 = new StreamingDetectIntentRequest(); + $request2->setSession($formattedSession2); + $request2->setQueryInput($queryInput2); + $formattedSession3 = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $queryInput3 = new QueryInput(); + $request3 = new StreamingDetectIntentRequest(); + $request3->setSession($formattedSession3); + $request3->setQueryInput($queryInput3); + $bidi = $gapicClient->streamingDetectIntent(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Sessions/StreamingDetectIntent', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamingDetectIntentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamingDetectIntent(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function detectIntentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $responseId = 'responseId1847552473'; + $outputAudio = '24'; + $expectedResponse = new DetectIntentResponse(); + $expectedResponse->setResponseId($responseId); + $expectedResponse->setOutputAudio($outputAudio); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSession = $gapicClient->sessionName('[PROJECT]', '[SESSION]'); + $queryInput = new QueryInput(); + $request = (new DetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + $response = $gapicClient->detectIntentAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Sessions/DetectIntent', $actualFuncCall); + $actualValue = $actualRequestObject->getSession(); + $this->assertProtobufEquals($formattedSession, $actualValue); + $actualValue = $actualRequestObject->getQueryInput(); + $this->assertProtobufEquals($queryInput, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SipTrunksClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SipTrunksClientTest.php new file mode 100644 index 000000000000..1d48894766fa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SipTrunksClientTest.php @@ -0,0 +1,578 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SipTrunksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SipTrunksClient($options); + } + + /** @test */ + public function createSipTrunkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new SipTrunk(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sipTrunk = new SipTrunk(); + $sipTrunkExpectedHostname = []; + $sipTrunk->setExpectedHostname($sipTrunkExpectedHostname); + $request = (new CreateSipTrunkRequest()) + ->setParent($formattedParent) + ->setSipTrunk($sipTrunk); + $response = $gapicClient->createSipTrunk($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SipTrunks/CreateSipTrunk', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSipTrunk(); + $this->assertProtobufEquals($sipTrunk, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSipTrunkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sipTrunk = new SipTrunk(); + $sipTrunkExpectedHostname = []; + $sipTrunk->setExpectedHostname($sipTrunkExpectedHostname); + $request = (new CreateSipTrunkRequest()) + ->setParent($formattedParent) + ->setSipTrunk($sipTrunk); + try { + $gapicClient->createSipTrunk($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSipTrunkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sipTrunkName('[PROJECT]', '[LOCATION]', '[SIPTRUNK]'); + $request = (new DeleteSipTrunkRequest()) + ->setName($formattedName); + $gapicClient->deleteSipTrunk($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SipTrunks/DeleteSipTrunk', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSipTrunkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sipTrunkName('[PROJECT]', '[LOCATION]', '[SIPTRUNK]'); + $request = (new DeleteSipTrunkRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteSipTrunk($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSipTrunkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new SipTrunk(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sipTrunkName('[PROJECT]', '[LOCATION]', '[SIPTRUNK]'); + $request = (new GetSipTrunkRequest()) + ->setName($formattedName); + $response = $gapicClient->getSipTrunk($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SipTrunks/GetSipTrunk', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSipTrunkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->sipTrunkName('[PROJECT]', '[LOCATION]', '[SIPTRUNK]'); + $request = (new GetSipTrunkRequest()) + ->setName($formattedName); + try { + $gapicClient->getSipTrunk($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSipTrunksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sipTrunksElement = new SipTrunk(); + $sipTrunks = [ + $sipTrunksElement, + ]; + $expectedResponse = new ListSipTrunksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSipTrunks($sipTrunks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSipTrunksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSipTrunks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSipTrunks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SipTrunks/ListSipTrunks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSipTrunksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSipTrunksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSipTrunks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSipTrunkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new SipTrunk(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $sipTrunk = new SipTrunk(); + $sipTrunkExpectedHostname = []; + $sipTrunk->setExpectedHostname($sipTrunkExpectedHostname); + $request = (new UpdateSipTrunkRequest()) + ->setSipTrunk($sipTrunk); + $response = $gapicClient->updateSipTrunk($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SipTrunks/UpdateSipTrunk', $actualFuncCall); + $actualValue = $actualRequestObject->getSipTrunk(); + $this->assertProtobufEquals($sipTrunk, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSipTrunkExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $sipTrunk = new SipTrunk(); + $sipTrunkExpectedHostname = []; + $sipTrunk->setExpectedHostname($sipTrunkExpectedHostname); + $request = (new UpdateSipTrunkRequest()) + ->setSipTrunk($sipTrunk); + try { + $gapicClient->updateSipTrunk($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSipTrunkAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new SipTrunk(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sipTrunk = new SipTrunk(); + $sipTrunkExpectedHostname = []; + $sipTrunk->setExpectedHostname($sipTrunkExpectedHostname); + $request = (new CreateSipTrunkRequest()) + ->setParent($formattedParent) + ->setSipTrunk($sipTrunk); + $response = $gapicClient->createSipTrunkAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.SipTrunks/CreateSipTrunk', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSipTrunk(); + $this->assertProtobufEquals($sipTrunk, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ToolsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ToolsClientTest.php new file mode 100644 index 000000000000..25336528c589 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ToolsClientTest.php @@ -0,0 +1,610 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ToolsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ToolsClient($options); + } + + /** @test */ + public function createToolTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $toolKey = 'toolKey-983258312'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Tool(); + $expectedResponse->setName($name); + $expectedResponse->setToolKey($toolKey); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tool = new Tool(); + $toolToolKey = 'toolToolKey-1620580113'; + $tool->setToolKey($toolToolKey); + $request = (new CreateToolRequest()) + ->setParent($formattedParent) + ->setTool($tool); + $response = $gapicClient->createTool($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Tools/CreateTool', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTool(); + $this->assertProtobufEquals($tool, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createToolExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tool = new Tool(); + $toolToolKey = 'toolToolKey-1620580113'; + $tool->setToolKey($toolToolKey); + $request = (new CreateToolRequest()) + ->setParent($formattedParent) + ->setTool($tool); + try { + $gapicClient->createTool($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteToolTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->toolName('[PROJECT]', '[LOCATION]', '[TOOL]'); + $request = (new DeleteToolRequest()) + ->setName($formattedName); + $gapicClient->deleteTool($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Tools/DeleteTool', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteToolExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->toolName('[PROJECT]', '[LOCATION]', '[TOOL]'); + $request = (new DeleteToolRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteTool($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getToolTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $toolKey = 'toolKey-983258312'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Tool(); + $expectedResponse->setName($name2); + $expectedResponse->setToolKey($toolKey); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->toolName('[PROJECT]', '[LOCATION]', '[TOOL]'); + $request = (new GetToolRequest()) + ->setName($formattedName); + $response = $gapicClient->getTool($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Tools/GetTool', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getToolExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->toolName('[PROJECT]', '[LOCATION]', '[TOOL]'); + $request = (new GetToolRequest()) + ->setName($formattedName); + try { + $gapicClient->getTool($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listToolsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $toolsElement = new Tool(); + $tools = [ + $toolsElement, + ]; + $expectedResponse = new ListToolsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTools($tools); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListToolsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTools($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTools()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Tools/ListTools', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listToolsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListToolsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTools($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateToolTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $toolKey = 'toolKey-983258312'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Tool(); + $expectedResponse->setName($name); + $expectedResponse->setToolKey($toolKey); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $tool = new Tool(); + $toolToolKey = 'toolToolKey-1620580113'; + $tool->setToolKey($toolToolKey); + $request = (new UpdateToolRequest()) + ->setTool($tool); + $response = $gapicClient->updateTool($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Tools/UpdateTool', $actualFuncCall); + $actualValue = $actualRequestObject->getTool(); + $this->assertProtobufEquals($tool, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateToolExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $tool = new Tool(); + $toolToolKey = 'toolToolKey-1620580113'; + $tool->setToolKey($toolToolKey); + $request = (new UpdateToolRequest()) + ->setTool($tool); + try { + $gapicClient->updateTool($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createToolAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $toolKey = 'toolKey-983258312'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Tool(); + $expectedResponse->setName($name); + $expectedResponse->setToolKey($toolKey); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $tool = new Tool(); + $toolToolKey = 'toolToolKey-1620580113'; + $tool->setToolKey($toolToolKey); + $request = (new CreateToolRequest()) + ->setParent($formattedParent) + ->setTool($tool); + $response = $gapicClient->createToolAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Tools/CreateTool', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTool(); + $this->assertProtobufEquals($tool, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php new file mode 100644 index 000000000000..567d6fb113d3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php @@ -0,0 +1,583 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VersionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VersionsClient($options); + } + + /** @test */ + public function createVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $versionNumber = 135927952; + $expectedResponse = new Version(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $version = new Version(); + $request = (new CreateVersionRequest()) + ->setParent($formattedParent) + ->setVersion($version); + $response = $gapicClient->createVersion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Versions/CreateVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getVersion(); + $this->assertProtobufEquals($version, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $version = new Version(); + $request = (new CreateVersionRequest()) + ->setParent($formattedParent) + ->setVersion($version); + try { + $gapicClient->createVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->versionName('[PROJECT]', '[VERSION]'); + $request = (new DeleteVersionRequest()) + ->setName($formattedName); + $gapicClient->deleteVersion($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Versions/DeleteVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->versionName('[PROJECT]', '[VERSION]'); + $request = (new DeleteVersionRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $versionNumber = 135927952; + $expectedResponse = new Version(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->versionName('[PROJECT]', '[VERSION]'); + $request = (new GetVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->getVersion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Versions/GetVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->versionName('[PROJECT]', '[VERSION]'); + $request = (new GetVersionRequest()) + ->setName($formattedName); + try { + $gapicClient->getVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $versionsElement = new Version(); + $versions = [ + $versionsElement, + ]; + $expectedResponse = new ListVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setVersions($versions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListVersionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listVersions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Versions/ListVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listVersionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $request = (new ListVersionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listVersions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $versionNumber = 135927952; + $expectedResponse = new Version(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $version = new Version(); + $updateMask = new FieldMask(); + $request = (new UpdateVersionRequest()) + ->setVersion($version) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateVersion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Versions/UpdateVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getVersion(); + $this->assertProtobufEquals($version, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $version = new Version(); + $updateMask = new FieldMask(); + $request = (new UpdateVersionRequest()) + ->setVersion($version) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createVersionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $versionNumber = 135927952; + $expectedResponse = new Version(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setVersionNumber($versionNumber); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->agentName('[PROJECT]'); + $version = new Version(); + $request = (new CreateVersionRequest()) + ->setParent($formattedParent) + ->setVersion($version); + $response = $gapicClient->createVersionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Versions/CreateVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getVersion(); + $this->assertProtobufEquals($version, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +}