From df0e91ea6d4f1540a51ba4a6ee2daa5b011a7994 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 20 Jun 2023 21:59:10 +0000 Subject: [PATCH 1/2] feat: added dialogflow_assist_answer feat: added session_ttl feat: added human_agent_side_config feat: added suggestion_input feat: added suggest_dialogflow_assists_response feat: added suggest_entity_extraction_response PiperOrigin-RevId: 542021587 Source-Link: https://github.com/googleapis/googleapis/commit/f40416dd8e0b3c6ef0d696cf772b04ce153fc5f5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/04ca491dec8f35173ee599d7ed07936b4086e96d Copy-Tag: eyJwIjoiRGlhbG9nZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiMDRjYTQ5MWRlYzhmMzUxNzNlZTU5OWQ3ZWQwNzkzNmI0MDg2ZTk2ZCJ9 --- .../Google/Cloud/Dialogflow/V2/Agent.php | Bin 0 -> 5894 bytes .../Cloud/Dialogflow/V2/AnswerRecord.php | Bin 0 -> 4426 bytes .../Cloud/Dialogflow/V2/AudioConfig.php | Bin 0 -> 3603 bytes .../Google/Cloud/Dialogflow/V2/Context.php | 70 + .../Cloud/Dialogflow/V2/Conversation.php | Bin 0 -> 6974 bytes .../Dialogflow/V2/ConversationDataset.php | Bin 0 -> 5192 bytes .../Cloud/Dialogflow/V2/ConversationEvent.php | Bin 0 -> 1358 bytes .../Cloud/Dialogflow/V2/ConversationModel.php | Bin 0 -> 9183 bytes .../Dialogflow/V2/ConversationProfile.php | Bin 0 -> 11256 bytes .../Google/Cloud/Dialogflow/V2/Document.php | Bin 0 -> 7758 bytes .../Google/Cloud/Dialogflow/V2/EntityType.php | Bin 0 -> 7509 bytes .../Cloud/Dialogflow/V2/Environment.php | Bin 0 -> 5522 bytes .../Cloud/Dialogflow/V2/Fulfillment.php | Bin 0 -> 2908 bytes .../Google/Cloud/Dialogflow/V2/Gcs.php | 33 + .../V2/HumanAgentAssistantEvent.php | 32 + .../Google/Cloud/Dialogflow/V2/Intent.php | Bin 0 -> 12742 bytes .../Cloud/Dialogflow/V2/KnowledgeBase.php | 66 + .../Cloud/Dialogflow/V2/Participant.php | Bin 0 -> 12033 bytes .../Google/Cloud/Dialogflow/V2/Session.php | Bin 0 -> 7687 bytes .../Cloud/Dialogflow/V2/SessionEntityType.php | Bin 0 -> 5745 bytes .../Cloud/Dialogflow/V2/ValidationResult.php | Bin 0 -> 1126 bytes .../Google/Cloud/Dialogflow/V2/Version.php | Bin 0 -> 3769 bytes .../Google/Cloud/Dialogflow/V2/Webhook.php | 50 + .../src/Google/Cloud/Dialogflow/V2/Agent.php | 541 ++++++ .../Cloud/Dialogflow/V2/Agent/ApiVersion.php | 71 + .../Cloud/Dialogflow/V2/Agent/MatchMode.php | 66 + .../Google/Cloud/Dialogflow/V2/Agent/Tier.php | 72 + .../Dialogflow/V2/AgentAssistantFeedback.php | 243 +++ .../AnswerRelevance.php | 64 + .../DocumentCorrectness.php | 64 + .../DocumentEfficiency.php | 64 + .../SummarizationFeedback.php | 158 ++ .../Dialogflow/V2/AgentAssistantRecord.php | 108 ++ .../Dialogflow/V2/AnalyzeContentRequest.php | 437 +++++ .../Dialogflow/V2/AnalyzeContentResponse.php | 428 ++++ .../Dialogflow/V2/AnnotatedMessagePart.php | 195 ++ .../Cloud/Dialogflow/V2/AnswerFeedback.php | 282 +++ .../V2/AnswerFeedback/CorrectnessLevel.php | 71 + .../Cloud/Dialogflow/V2/AnswerRecord.php | 189 ++ .../Cloud/Dialogflow/V2/ArticleAnswer.php | 261 +++ .../V2/ArticleSuggestionModelMetadata.php | 71 + .../Dialogflow/V2/AssistQueryParameters.php | 131 ++ .../Cloud/Dialogflow/V2/AudioEncoding.php | 118 ++ .../Dialogflow/V2/AutomatedAgentConfig.php | 175 ++ .../Dialogflow/V2/AutomatedAgentReply.php | 203 ++ .../AutomatedAgentReplyType.php | 70 + .../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 + ...ggestionFeatureConfigOperationMetadata.php | 192 ++ .../ClearSuggestionFeatureConfigRequest.php | 184 ++ .../V2/CloudConversationDebuggingInfo.php | 706 +++++++ .../V2/CompleteConversationRequest.php | 92 + .../Google/Cloud/Dialogflow/V2/Context.php | 269 +++ .../Cloud/Dialogflow/V2/Conversation.php | 380 ++++ .../V2/Conversation/ConversationStage.php | 69 + .../V2/Conversation/LifecycleState.php | 64 + .../Dialogflow/V2/ConversationDataset.php | 316 +++ .../Cloud/Dialogflow/V2/ConversationEvent.php | 200 ++ .../Dialogflow/V2/ConversationEvent/Type.php | 96 + .../Cloud/Dialogflow/V2/ConversationInfo.php | 75 + .../Cloud/Dialogflow/V2/ConversationModel.php | 346 ++++ .../V2/ConversationModel/ModelType.php | 64 + .../Dialogflow/V2/ConversationModel/State.php | 108 ++ .../V2/ConversationModelEvaluation.php | 329 ++++ .../Dialogflow/V2/ConversationPhoneNumber.php | 68 + .../Dialogflow/V2/ConversationProfile.php | 703 +++++++ .../Dialogflow/V2/CreateContextRequest.php | 153 ++ ...teConversationDatasetOperationMetadata.php | 75 + .../V2/CreateConversationDatasetRequest.php | 132 ++ ...sationModelEvaluationOperationMetadata.php | 201 ++ .../State.php | 85 + ...eateConversationModelEvaluationRequest.php | 138 ++ ...eateConversationModelOperationMetadata.php | 155 ++ .../State.php | 94 + .../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 ++ .../Dialogflow/V2/CreateIntentRequest.php | 240 +++ .../V2/CreateKnowledgeBaseRequest.php | 133 ++ .../V2/CreateParticipantRequest.php | 138 ++ .../V2/CreateSessionEntityTypeRequest.php | 153 ++ .../Dialogflow/V2/CreateVersionRequest.php | 144 ++ .../Dialogflow/V2/DeleteAgentRequest.php | 87 + .../V2/DeleteAllContextsRequest.php | 107 + .../Dialogflow/V2/DeleteContextRequest.php | 107 + ...teConversationDatasetOperationMetadata.php | 33 + .../V2/DeleteConversationDatasetRequest.php | 92 + ...leteConversationModelOperationMetadata.php | 121 ++ .../V2/DeleteConversationModelRequest.php | 86 + .../V2/DeleteConversationProfileRequest.php | 94 + .../Dialogflow/V2/DeleteDocumentRequest.php | 92 + .../Dialogflow/V2/DeleteEntityTypeRequest.php | 87 + .../V2/DeleteEnvironmentRequest.php | 88 + .../Dialogflow/V2/DeleteIntentRequest.php | 92 + .../V2/DeleteKnowledgeBaseRequest.php | 130 ++ .../V2/DeleteSessionEntityTypeRequest.php | 112 ++ .../Dialogflow/V2/DeleteVersionRequest.php | 103 + ...ployConversationModelOperationMetadata.php | 121 ++ .../V2/DeployConversationModelRequest.php | 72 + .../Dialogflow/V2/DetectIntentRequest.php | 428 ++++ .../Dialogflow/V2/DetectIntentResponse.php | 273 +++ .../Google/Cloud/Dialogflow/V2/Document.php | 500 +++++ .../Dialogflow/V2/Document/KnowledgeType.php | 85 + .../Dialogflow/V2/Document/ReloadStatus.php | 132 ++ .../Cloud/Dialogflow/V2/Document/State.php | 85 + .../Cloud/Dialogflow/V2/DtmfParameters.php | 67 + .../Google/Cloud/Dialogflow/V2/EntityType.php | 274 +++ .../V2/EntityType/AutoExpansionMode.php | 60 + .../Cloud/Dialogflow/V2/EntityType/Entity.php | 148 ++ .../Cloud/Dialogflow/V2/EntityType/Kind.php | 75 + .../Cloud/Dialogflow/V2/EntityTypeBatch.php | 67 + .../Cloud/Dialogflow/V2/Environment.php | 362 ++++ .../Cloud/Dialogflow/V2/Environment/State.php | 75 + .../Dialogflow/V2/EnvironmentHistory.php | 164 ++ .../V2/EnvironmentHistory/Entry.php | 148 ++ .../Cloud/Dialogflow/V2/EvaluationConfig.php | 142 ++ .../EvaluationConfig/SmartComposeConfig.php | 124 ++ .../V2/EvaluationConfig/SmartReplyConfig.php | 124 ++ .../Google/Cloud/Dialogflow/V2/EventInput.php | 229 +++ .../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/Fulfillment.php | 247 +++ .../Dialogflow/V2/Fulfillment/Feature.php | 70 + .../V2/Fulfillment/Feature/Type.php | 57 + .../V2/Fulfillment/GenericWebService.php | 236 +++ .../Cloud/Dialogflow/V2/GcsDestination.php | 83 + .../Google/Cloud/Dialogflow/V2/GcsSources.php | 75 + .../V2/GenerateStatelessSummaryRequest.php | 222 +++ .../MinimalConversation.php | 125 ++ .../V2/GenerateStatelessSummaryResponse.php | 166 ++ .../Summary.php | 112 ++ .../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 + .../Dialogflow/V2/GetEntityTypeRequest.php | 158 ++ .../V2/GetEnvironmentHistoryRequest.php | 160 ++ .../Dialogflow/V2/GetEnvironmentRequest.php | 88 + .../Dialogflow/V2/GetFulfillmentRequest.php | 87 + .../Cloud/Dialogflow/V2/GetIntentRequest.php | 192 ++ .../Dialogflow/V2/GetKnowledgeBaseRequest.php | 92 + .../Dialogflow/V2/GetParticipantRequest.php | 92 + .../V2/GetSessionEntityTypeRequest.php | 112 ++ .../V2/GetValidationResultRequest.php | 122 ++ .../Cloud/Dialogflow/V2/GetVersionRequest.php | 103 + .../V2/HumanAgentAssistantConfig.php | 217 +++ .../ConversationModelConfig.php | 138 ++ .../ConversationProcessConfig.php | 74 + .../MessageAnalysisConfig.php | 196 ++ .../SuggestionConfig.php | 140 ++ .../SuggestionFeatureConfig.php | 302 +++ .../SuggestionQueryConfig.php | 326 ++++ .../ContextFilterSettings.php | 143 ++ .../DialogflowQuerySource.php | 83 + .../DocumentQuerySource.php | 83 + .../KnowledgeBaseQuerySource.php | 83 + .../SuggestionTriggerSettings.php | 108 ++ .../V2/HumanAgentAssistantEvent.php | 148 ++ .../Dialogflow/V2/HumanAgentHandoffConfig.php | 111 ++ .../LivePersonConfig.php | 74 + .../SalesforceLiveAgentConfig.php | 184 ++ .../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 + .../Cloud/Dialogflow/V2/InputAudioConfig.php | 624 ++++++ .../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 | 112 ++ .../Cloud/Dialogflow/V2/Intent/Message.php | 545 ++++++ .../V2/Intent/Message/BasicCard.php | 216 +++ .../V2/Intent/Message/BasicCard/Button.php | 114 ++ .../BasicCard/Button/OpenUriAction.php | 70 + .../V2/Intent/Message/BrowseCarouselCard.php | 113 ++ .../BrowseCarouselCardItem.php | 234 +++ .../BrowseCarouselCardItem/OpenUrlAction.php | 108 ++ .../OpenUrlAction/UrlTypeHint.php | 65 + .../ImageDisplayOptions.php | 89 + .../Dialogflow/V2/Intent/Message/Card.php | 172 ++ .../V2/Intent/Message/Card/Button.php | 108 ++ .../V2/Intent/Message/CarouselSelect.php | 70 + .../V2/Intent/Message/CarouselSelect/Item.php | 192 ++ .../V2/Intent/Message/ColumnProperties.php | 105 + .../ColumnProperties/HorizontalAlignment.php | 71 + .../Dialogflow/V2/Intent/Message/Image.php | 108 ++ .../V2/Intent/Message/LinkOutSuggestion.php | 109 ++ .../V2/Intent/Message/ListSelect.php | 138 ++ .../V2/Intent/Message/ListSelect/Item.php | 192 ++ .../V2/Intent/Message/MediaContent.php | 104 + .../MediaContent/ResponseMediaObject.php | 213 ++ .../MediaContent/ResponseMediaType.php | 57 + .../Dialogflow/V2/Intent/Message/Platform.php | 116 ++ .../V2/Intent/Message/QuickReplies.php | 104 + .../V2/Intent/Message/SelectItemInfo.php | 113 ++ .../V2/Intent/Message/SimpleResponse.php | 150 ++ .../V2/Intent/Message/SimpleResponses.php | 73 + .../V2/Intent/Message/Suggestion.php | 71 + .../V2/Intent/Message/Suggestions.php | 70 + .../V2/Intent/Message/TableCard.php | 250 +++ .../V2/Intent/Message/TableCardCell.php | 71 + .../V2/Intent/Message/TableCardRow.php | 104 + .../Dialogflow/V2/Intent/Message/Text.php | 70 + .../Cloud/Dialogflow/V2/Intent/Parameter.php | 360 ++++ .../Dialogflow/V2/Intent/TrainingPhrase.php | 240 +++ .../V2/Intent/TrainingPhrase/Part.php | 196 ++ .../V2/Intent/TrainingPhrase/Type.php | 70 + .../Dialogflow/V2/Intent/WebhookState.php | 65 + .../Cloud/Dialogflow/V2/IntentBatch.php | 67 + .../Google/Cloud/Dialogflow/V2/IntentView.php | 56 + .../Cloud/Dialogflow/V2/KnowledgeBase.php | 166 ++ .../V2/KnowledgeOperationMetadata.php | 143 ++ .../V2/KnowledgeOperationMetadata/State.php | 71 + .../V2/ListAnswerRecordsRequest.php | 231 +++ .../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 | 249 +++ .../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 ++ .../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/ListVersionsRequest.php | 170 ++ .../Dialogflow/V2/ListVersionsResponse.php | 110 ++ .../Cloud/Dialogflow/V2/LoggingConfig.php | 79 + .../Google/Cloud/Dialogflow/V2/Message.php | 395 ++++ .../Cloud/Dialogflow/V2/MessageAnnotation.php | 109 ++ .../Dialogflow/V2/NotificationConfig.php | 149 ++ .../V2/NotificationConfig/MessageFormat.php | 64 + .../V2/OriginalDetectIntentRequest.php | 202 ++ .../Cloud/Dialogflow/V2/OutputAudio.php | 115 ++ .../Cloud/Dialogflow/V2/OutputAudioConfig.php | 163 ++ .../Dialogflow/V2/OutputAudioEncoding.php | 86 + .../Cloud/Dialogflow/V2/Participant.php | 387 ++++ .../Cloud/Dialogflow/V2/Participant/Role.php | 72 + .../Google/Cloud/Dialogflow/V2/QueryInput.php | 148 ++ .../Cloud/Dialogflow/V2/QueryParameters.php | 415 ++++ .../Cloud/Dialogflow/V2/QueryResult.php | 855 ++++++++ .../Dialogflow/V2/ReloadDocumentRequest.php | 225 +++ .../Dialogflow/V2/RestoreAgentRequest.php | 165 ++ .../Dialogflow/V2/SearchAgentsRequest.php | 159 ++ .../Dialogflow/V2/SearchAgentsResponse.php | 110 ++ .../Google/Cloud/Dialogflow/V2/Sentiment.php | 112 ++ .../V2/SentimentAnalysisRequestConfig.php | 75 + .../Dialogflow/V2/SentimentAnalysisResult.php | 89 + .../Cloud/Dialogflow/V2/SessionEntityType.php | 181 ++ .../SessionEntityType/EntityOverrideMode.php | 73 + .../Cloud/Dialogflow/V2/SetAgentRequest.php | 135 ++ ...ggestionFeatureConfigOperationMetadata.php | 192 ++ .../V2/SetSuggestionFeatureConfigRequest.php | 194 ++ .../Cloud/Dialogflow/V2/SmartReplyAnswer.php | 155 ++ .../Cloud/Dialogflow/V2/SmartReplyMetrics.php | 143 ++ .../V2/SmartReplyMetrics/TopNMetrics.php | 124 ++ .../Dialogflow/V2/SmartReplyModelMetadata.php | 71 + .../Cloud/Dialogflow/V2/SpeechContext.php | 162 ++ .../Dialogflow/V2/SpeechModelVariant.php | 92 + .../Dialogflow/V2/SpeechToTextConfig.php | 158 ++ .../Cloud/Dialogflow/V2/SpeechWordInfo.php | 225 +++ .../Cloud/Dialogflow/V2/SsmlVoiceGender.php | 70 + .../V2/StreamingAnalyzeContentRequest.php | 603 ++++++ .../V2/StreamingAnalyzeContentResponse.php | 500 +++++ .../V2/StreamingDetectIntentRequest.php | 522 +++++ .../V2/StreamingDetectIntentResponse.php | 371 ++++ .../V2/StreamingRecognitionResult.php | 363 ++++ .../MessageType.php | 71 + .../Dialogflow/V2/SuggestArticlesRequest.php | 228 +++ .../Dialogflow/V2/SuggestArticlesResponse.php | 168 ++ .../V2/SuggestConversationSummaryRequest.php | 228 +++ .../V2/SuggestConversationSummaryResponse.php | 170 ++ .../Summary.php | 150 ++ .../V2/SuggestFaqAnswersRequest.php | 224 +++ .../V2/SuggestFaqAnswersResponse.php | 168 ++ .../V2/SuggestSmartRepliesRequest.php | 232 +++ .../V2/SuggestSmartRepliesResponse.php | 176 ++ .../Cloud/Dialogflow/V2/SuggestionFeature.php | 69 + .../Dialogflow/V2/SuggestionFeature/Type.php | 71 + .../Cloud/Dialogflow/V2/SuggestionResult.php | 180 ++ .../Dialogflow/V2/SynthesizeSpeechConfig.php | 269 +++ .../Cloud/Dialogflow/V2/TelephonyDtmf.php | 160 ++ .../Dialogflow/V2/TelephonyDtmfEvents.php | 67 + .../Google/Cloud/Dialogflow/V2/TextInput.php | 119 ++ .../Dialogflow/V2/TextToSpeechSettings.php | 197 ++ .../Cloud/Dialogflow/V2/TrainAgentRequest.php | 87 + ...ployConversationModelOperationMetadata.php | 121 ++ .../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/UpdateIntentRequest.php | 246 +++ .../V2/UpdateKnowledgeBaseRequest.php | 147 ++ .../V2/UpdateParticipantRequest.php | 137 ++ .../V2/UpdateSessionEntityTypeRequest.php | 150 ++ .../Dialogflow/V2/UpdateVersionRequest.php | 158 ++ .../Cloud/Dialogflow/V2/ValidationError.php | 183 ++ .../V2/ValidationError/Severity.php | 78 + .../Cloud/Dialogflow/V2/ValidationResult.php | 67 + .../Google/Cloud/Dialogflow/V2/Version.php | 254 +++ .../Dialogflow/V2/Version/VersionStatus.php | 71 + .../Dialogflow/V2/VoiceSelectionParams.php | 129 ++ .../Cloud/Dialogflow/V2/WebhookRequest.php | 217 +++ .../Cloud/Dialogflow/V2/WebhookResponse.php | 430 ++++ .../samples/V2/AgentsClient/delete_agent.php | 65 + .../samples/V2/AgentsClient/export_agent.php | 99 + .../v2/samples/V2/AgentsClient/get_agent.php | 67 + .../samples/V2/AgentsClient/get_location.php | 53 + .../V2/AgentsClient/get_validation_result.php | 68 + .../samples/V2/AgentsClient/import_agent.php | 102 + .../V2/AgentsClient/list_locations.php | 58 + .../samples/V2/AgentsClient/restore_agent.php | 100 + .../samples/V2/AgentsClient/search_agents.php | 78 + .../v2/samples/V2/AgentsClient/set_agent.php | 99 + .../samples/V2/AgentsClient/train_agent.php | 89 + .../V2/AnswerRecordsClient/get_location.php | 53 + .../list_answer_records.php | 74 + .../V2/AnswerRecordsClient/list_locations.php | 58 + .../update_answer_record.php | 61 + .../V2/ContextsClient/create_context.php | 95 + .../V2/ContextsClient/delete_all_contexts.php | 69 + .../V2/ContextsClient/delete_context.php | 69 + .../samples/V2/ContextsClient/get_context.php | 71 + .../V2/ContextsClient/get_location.php | 53 + .../V2/ContextsClient/list_contexts.php | 76 + .../V2/ContextsClient/list_locations.php | 58 + .../V2/ContextsClient/update_context.php | 85 + .../create_conversation_dataset.php | 95 + .../delete_conversation_dataset.php | 90 + .../get_conversation_dataset.php | 72 + .../get_location.php | 53 + .../import_conversation_data.php | 99 + .../list_conversation_datasets.php | 73 + .../list_locations.php | 58 + .../create_conversation_model.php | 109 ++ .../create_conversation_model_evaluation.php | 90 + .../delete_conversation_model.php | 84 + .../deploy_conversation_model.php | 87 + .../get_conversation_model.php | 66 + .../get_conversation_model_evaluation.php | 67 + .../ConversationModelsClient/get_location.php | 53 + .../list_conversation_model_evaluations.php | 71 + .../list_conversation_models.php | 71 + .../list_locations.php | 58 + .../undeploy_conversation_model.php | 87 + .../clear_suggestion_feature_config.php | 107 + .../create_conversation_profile.php | 83 + .../delete_conversation_profile.php | 69 + .../get_conversation_profile.php | 71 + .../get_location.php | 53 + .../list_conversation_profiles.php | 72 + .../list_locations.php | 58 + .../set_suggestion_feature_config.php | 110 ++ .../update_conversation_profile.php | 79 + .../complete_conversation.php | 69 + .../create_conversation.php | 102 + .../generate_stateless_summary.php | 98 + .../ConversationsClient/get_conversation.php | 68 + .../V2/ConversationsClient/get_location.php | 53 + .../list_conversations.php | 72 + .../V2/ConversationsClient/list_locations.php | 58 + .../V2/ConversationsClient/list_messages.php | 77 + .../suggest_conversation_summary.php | 70 + .../V2/DocumentsClient/create_document.php | 112 ++ .../V2/DocumentsClient/delete_document.php | 86 + .../V2/DocumentsClient/export_document.php | 89 + .../V2/DocumentsClient/get_document.php | 68 + .../V2/DocumentsClient/get_location.php | 53 + .../V2/DocumentsClient/import_documents.php | 110 ++ .../V2/DocumentsClient/list_documents.php | 73 + .../V2/DocumentsClient/list_locations.php | 58 + .../V2/DocumentsClient/reload_document.php | 94 + .../V2/DocumentsClient/update_document.php | 101 + .../batch_create_entities.php | 121 ++ .../batch_delete_entities.php | 96 + .../batch_delete_entity_types.php | 97 + .../batch_update_entities.php | 124 ++ .../batch_update_entity_types.php | 92 + .../EntityTypesClient/create_entity_type.php | 84 + .../EntityTypesClient/delete_entity_type.php | 69 + .../V2/EntityTypesClient/get_entity_type.php | 67 + .../V2/EntityTypesClient/get_location.php | 53 + .../EntityTypesClient/list_entity_types.php | 72 + .../V2/EntityTypesClient/list_locations.php | 58 + .../EntityTypesClient/update_entity_type.php | 77 + .../EnvironmentsClient/create_environment.php | 75 + .../EnvironmentsClient/delete_environment.php | 71 + .../V2/EnvironmentsClient/get_environment.php | 73 + .../get_environment_history.php | 78 + .../V2/EnvironmentsClient/get_location.php | 53 + .../EnvironmentsClient/list_environments.php | 75 + .../V2/EnvironmentsClient/list_locations.php | 58 + .../EnvironmentsClient/update_environment.php | 69 + .../V2/FulfillmentsClient/get_fulfillment.php | 67 + .../V2/FulfillmentsClient/get_location.php | 53 + .../V2/FulfillmentsClient/list_locations.php | 58 + .../FulfillmentsClient/update_fulfillment.php | 77 + .../V2/IntentsClient/batch_delete_intents.php | 97 + .../V2/IntentsClient/batch_update_intents.php | 92 + .../V2/IntentsClient/create_intent.php | 77 + .../V2/IntentsClient/delete_intent.php | 70 + .../samples/V2/IntentsClient/get_intent.php | 67 + .../samples/V2/IntentsClient/get_location.php | 53 + .../samples/V2/IntentsClient/list_intents.php | 80 + .../V2/IntentsClient/list_locations.php | 58 + .../V2/IntentsClient/update_intent.php | 73 + .../create_knowledge_base.php | 76 + .../delete_knowledge_base.php | 66 + .../get_knowledge_base.php | 68 + .../V2/KnowledgeBasesClient/get_location.php | 53 + .../list_knowledge_bases.php | 72 + .../KnowledgeBasesClient/list_locations.php | 58 + .../update_knowledge_base.php | 70 + .../V2/ParticipantsClient/analyze_content.php | 77 + .../ParticipantsClient/create_participant.php | 71 + .../V2/ParticipantsClient/get_location.php | 53 + .../V2/ParticipantsClient/get_participant.php | 72 + .../V2/ParticipantsClient/list_locations.php | 58 + .../ParticipantsClient/list_participants.php | 73 + .../streaming_analyze_content.php | 97 + .../ParticipantsClient/suggest_articles.php | 73 + .../suggest_faq_answers.php | 73 + .../suggest_smart_replies.php | 73 + .../ParticipantsClient/update_participant.php | 58 + .../create_session_entity_type.php | 140 ++ .../delete_session_entity_type.php | 78 + .../SessionEntityTypesClient/get_location.php | 53 + .../get_session_entity_type.php | 80 + .../list_locations.php | 58 + .../list_session_entity_types.php | 80 + .../update_session_entity_type.php | 124 ++ .../V2/SessionsClient/detect_intent.php | 100 + .../V2/SessionsClient/get_location.php | 53 + .../V2/SessionsClient/list_locations.php | 58 + .../streaming_detect_intent.php | 109 ++ .../V2/VersionsClient/create_version.php | 75 + .../V2/VersionsClient/delete_version.php | 69 + .../V2/VersionsClient/get_location.php | 53 + .../samples/V2/VersionsClient/get_version.php | 71 + .../V2/VersionsClient/list_locations.php | 58 + .../V2/VersionsClient/list_versions.php | 75 + .../V2/VersionsClient/update_version.php | 62 + .../Dialogflow/v2/src/V2/AgentsClient.php | 34 + .../v2/src/V2/AnswerRecordsClient.php | 34 + .../v2/src/V2/Client/AgentsClient.php | 40 + .../v2/src/V2/Client/AnswerRecordsClient.php | 40 + .../V2/Client/BaseClient/AgentsBaseClient.php | 683 +++++++ .../BaseClient/AnswerRecordsBaseClient.php | 390 ++++ .../Client/BaseClient/ContextsBaseClient.php | 614 ++++++ .../ConversationDatasetsBaseClient.php | 487 +++++ .../ConversationModelsBaseClient.php | 765 ++++++++ .../ConversationProfilesBaseClient.php | 838 ++++++++ .../BaseClient/ConversationsBaseClient.php | 913 +++++++++ .../Client/BaseClient/DocumentsBaseClient.php | 669 +++++++ .../BaseClient/EntityTypesBaseClient.php | 727 +++++++ .../BaseClient/EnvironmentsBaseClient.php | 623 ++++++ .../BaseClient/FulfillmentsBaseClient.php | 348 ++++ .../Client/BaseClient/IntentsBaseClient.php | 821 ++++++++ .../BaseClient/KnowledgeBasesBaseClient.php | 465 +++++ .../BaseClient/ParticipantsBaseClient.php | 1006 ++++++++++ .../SessionEntityTypesBaseClient.php | 613 ++++++ .../Client/BaseClient/SessionsBaseClient.php | 648 +++++++ .../Client/BaseClient/VersionsBaseClient.php | 486 +++++ .../v2/src/V2/Client/ContextsClient.php | 40 + .../V2/Client/ConversationDatasetsClient.php | 40 + .../V2/Client/ConversationModelsClient.php | 40 + .../V2/Client/ConversationProfilesClient.php | 40 + .../v2/src/V2/Client/ConversationsClient.php | 40 + .../v2/src/V2/Client/DocumentsClient.php | 40 + .../v2/src/V2/Client/EntityTypesClient.php | 40 + .../v2/src/V2/Client/EnvironmentsClient.php | 40 + .../v2/src/V2/Client/FulfillmentsClient.php | 40 + .../v2/src/V2/Client/IntentsClient.php | 40 + .../v2/src/V2/Client/KnowledgeBasesClient.php | 40 + .../v2/src/V2/Client/ParticipantsClient.php | 40 + .../V2/Client/SessionEntityTypesClient.php | 40 + .../v2/src/V2/Client/SessionsClient.php | 40 + .../v2/src/V2/Client/VersionsClient.php | 40 + .../Dialogflow/v2/src/V2/ContextsClient.php | 34 + .../v2/src/V2/ConversationDatasetsClient.php | 34 + .../v2/src/V2/ConversationModelsClient.php | 34 + .../v2/src/V2/ConversationProfilesClient.php | 34 + .../v2/src/V2/ConversationsClient.php | 34 + .../Dialogflow/v2/src/V2/DocumentsClient.php | 34 + .../v2/src/V2/EntityTypesClient.php | 34 + .../v2/src/V2/EnvironmentsClient.php | 34 + .../v2/src/V2/FulfillmentsClient.php | 34 + .../v2/src/V2/Gapic/AgentsGapicClient.php | 1161 +++++++++++ .../src/V2/Gapic/AnswerRecordsGapicClient.php | 629 ++++++ .../v2/src/V2/Gapic/ContextsGapicClient.php | 977 ++++++++++ .../Gapic/ConversationDatasetsGapicClient.php | 817 ++++++++ .../Gapic/ConversationModelsGapicClient.php | 1327 +++++++++++++ .../Gapic/ConversationProfilesGapicClient.php | 1389 +++++++++++++ .../src/V2/Gapic/ConversationsGapicClient.php | 1565 +++++++++++++++ .../v2/src/V2/Gapic/DocumentsGapicClient.php | 1269 ++++++++++++ .../src/V2/Gapic/EntityTypesGapicClient.php | 1346 +++++++++++++ .../src/V2/Gapic/EnvironmentsGapicClient.php | 1054 ++++++++++ .../src/V2/Gapic/FulfillmentsGapicClient.php | 510 +++++ .../v2/src/V2/Gapic/IntentsGapicClient.php | 1441 ++++++++++++++ .../V2/Gapic/KnowledgeBasesGapicClient.php | 775 ++++++++ .../src/V2/Gapic/ParticipantsGapicClient.php | 1726 +++++++++++++++++ .../Gapic/SessionEntityTypesGapicClient.php | 959 +++++++++ .../v2/src/V2/Gapic/SessionsGapicClient.php | 1045 ++++++++++ .../v2/src/V2/Gapic/VersionsGapicClient.php | 782 ++++++++ .../Dialogflow/v2/src/V2/IntentsClient.php | 34 + .../v2/src/V2/KnowledgeBasesClient.php | 34 + .../v2/src/V2/ParticipantsClient.php | 34 + .../v2/src/V2/SessionEntityTypesClient.php | 34 + .../Dialogflow/v2/src/V2/SessionsClient.php | 34 + .../Dialogflow/v2/src/V2/VersionsClient.php | 34 + .../Dialogflow/v2/src/V2/gapic_metadata.json | 852 ++++++++ .../V2/resources/agents_client_config.json | 89 + .../V2/resources/agents_descriptor_config.php | 194 ++ .../resources/agents_rest_client_config.php | 250 +++ .../answer_records_client_config.json | 54 + .../answer_records_descriptor_config.php | 82 + .../answer_records_rest_client_config.php | 129 ++ .../V2/resources/contexts_client_config.json | 74 + .../resources/contexts_descriptor_config.php | 135 ++ .../resources/contexts_rest_client_config.php | 245 +++ .../conversation_datasets_client_config.json | 69 + ...onversation_datasets_descriptor_config.php | 135 ++ ...nversation_datasets_rest_client_config.php | 162 ++ .../conversation_models_client_config.json | 89 + .../conversation_models_descriptor_config.php | 213 ++ ...conversation_models_rest_client_config.php | 240 +++ .../conversation_profiles_client_config.json | 79 + ...onversation_profiles_descriptor_config.php | 169 ++ ...nversation_profiles_rest_client_config.php | 220 +++ .../conversations_client_config.json | 79 + .../conversations_descriptor_config.php | 169 ++ .../conversations_rest_client_config.php | 214 ++ .../V2/resources/documents_client_config.json | 84 + .../resources/documents_descriptor_config.php | 197 ++ .../documents_rest_client_config.php | 260 +++ .../resources/entity_types_client_config.json | 94 + .../entity_types_descriptor_config.php | 214 ++ .../entity_types_rest_client_config.php | 271 +++ .../resources/environments_client_config.json | 74 + .../environments_descriptor_config.php | 145 ++ .../environments_rest_client_config.php | 205 ++ .../resources/fulfillments_client_config.json | 54 + .../fulfillments_descriptor_config.php | 72 + .../fulfillments_rest_client_config.php | 129 ++ .../V2/resources/intents_client_config.json | 79 + .../resources/intents_descriptor_config.php | 167 ++ .../resources/intents_rest_client_config.php | 222 +++ .../knowledge_bases_client_config.json | 69 + .../knowledge_bases_descriptor_config.php | 118 ++ .../knowledge_bases_rest_client_config.php | 198 ++ .../resources/participants_client_config.json | 109 ++ .../participants_descriptor_config.php | 180 ++ .../participants_rest_client_config.php | 241 +++ .../session_entity_types_client_config.json | 69 + ...session_entity_types_descriptor_config.php | 123 ++ ...ession_entity_types_rest_client_config.php | 220 +++ .../V2/resources/sessions_client_config.json | 74 + .../resources/sessions_descriptor_config.php | 78 + .../resources/sessions_rest_client_config.php | 115 ++ .../V2/resources/versions_client_config.json | 69 + .../resources/versions_descriptor_config.php | 119 ++ .../resources/versions_rest_client_config.php | 182 ++ .../v2/tests/Unit/V2/AgentsClientTest.php | 1012 ++++++++++ .../tests/Unit/V2/AnswerRecordsClientTest.php | 322 +++ .../tests/Unit/V2/Client/AgentsClientTest.php | 1091 +++++++++++ .../V2/Client/AnswerRecordsClientTest.php | 377 ++++ .../Unit/V2/Client/ContextsClientTest.php | 640 ++++++ .../Client/ConversationDatasetsClientTest.php | 813 ++++++++ .../Client/ConversationModelsClientTest.php | 1191 ++++++++++++ .../Client/ConversationProfilesClientTest.php | 943 +++++++++ .../V2/Client/ConversationsClientTest.php | 736 +++++++ .../Unit/V2/Client/DocumentsClientTest.php | 1243 ++++++++++++ .../Unit/V2/Client/EntityTypesClientTest.php | 1263 ++++++++++++ .../Unit/V2/Client/EnvironmentsClientTest.php | 670 +++++++ .../Unit/V2/Client/FulfillmentsClientTest.php | 371 ++++ .../Unit/V2/Client/IntentsClientTest.php | 918 +++++++++ .../V2/Client/KnowledgeBasesClientTest.php | 586 ++++++ .../Unit/V2/Client/ParticipantsClientTest.php | 885 +++++++++ .../Client/SessionEntityTypesClientTest.php | 591 ++++++ .../Unit/V2/Client/SessionsClientTest.php | 413 ++++ .../Unit/V2/Client/VersionsClientTest.php | 583 ++++++ .../v2/tests/Unit/V2/ContextsClientTest.php | 565 ++++++ .../V2/ConversationDatasetsClientTest.php | 700 +++++++ .../Unit/V2/ConversationModelsClientTest.php | 1064 ++++++++++ .../V2/ConversationProfilesClientTest.php | 808 ++++++++ .../tests/Unit/V2/ConversationsClientTest.php | 660 +++++++ .../v2/tests/Unit/V2/DocumentsClientTest.php | 1109 +++++++++++ .../tests/Unit/V2/EntityTypesClientTest.php | 1129 +++++++++++ .../tests/Unit/V2/EnvironmentsClientTest.php | 587 ++++++ .../tests/Unit/V2/FulfillmentsClientTest.php | 320 +++ .../v2/tests/Unit/V2/IntentsClientTest.php | 805 ++++++++ .../Unit/V2/KnowledgeBasesClientTest.php | 514 +++++ .../tests/Unit/V2/ParticipantsClientTest.php | 806 ++++++++ .../Unit/V2/SessionEntityTypesClientTest.php | 519 +++++ .../v2/tests/Unit/V2/SessionsClientTest.php | 365 ++++ .../v2/tests/Unit/V2/VersionsClientTest.php | 511 +++++ 639 files changed, 128329 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/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/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/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/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/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/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/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/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/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/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/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/ConversationStage.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/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/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/CreateVersionRequest.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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/IntentView.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/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/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/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/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/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/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/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/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/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/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/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/SuggestionResult.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/TrainAgentRequest.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/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/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_summary.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/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/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/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/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_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/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/AgentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/AnswerRecordsClient.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/BaseClient/AgentsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AnswerRecordsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ContextsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationDatasetsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationModelsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationProfilesBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/DocumentsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EntityTypesBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EnvironmentsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/FulfillmentsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/IntentsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/KnowledgeBasesBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ParticipantsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionEntityTypesBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionsBaseClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/VersionsBaseClient.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/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/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/VersionsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationDatasetsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationModelsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationProfilesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/DocumentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/EntityTypesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/EnvironmentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/FulfillmentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AgentsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/KnowledgeBasesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ParticipantsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/SessionEntityTypesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/SessionsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/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/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/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/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/AgentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.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/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/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/VersionsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/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 0000000000000000000000000000000000000000..8801329edf7f6c5a32d59c63399cb53923aab95d GIT binary patch literal 5894 zcmb_gOLN=S6*eeKv5#y^zVd^nlLm(ESbhkMnMYeXP6rezi5)#S6r&ldoT4CjNg@FO z1OVmNxQkBv3$kgu$xLUm$ugVHblGKAopzV$qKmG&>#ChLi=2D$AVfnH<;WXTxaXXE z9^d)Sz4wEkI6Vihi>uV4uIAIW*m^4ZJt{h`?c2I-imgGXLtRm~`;K8!R~E(cmbkgq z5G&r%^?xk&&^>r>CsbSkda zN*mPI+M2I5SGjg`nQ1r6v37H(@BlzJHO~_jW(A&ui2s~H%QSS+^EDs;yJ2{$VHrNE z8P70=hhj%FJ&Kwy%XS8q?i;oxGKDQmr;E46z$TNu;n*1SLoxEF#?pW(XjUzsx|U`( z%hc0d!|`pmhN8t{m-=z?*q6oI;kL}2(GeE|AB)A8oO~$y?tmtD7e$x)1J`=M{bmMU z#J`#;*-{*%saTfHvS3?Yu{exrXyPEnWz)cX9!+P(pk}*7d)l61yGK*4(-0^VJDGxo z<_=aE@q*E!y@7cI_t$N!>kcf-u)57Hhk^ZQDT|SSb*S_m|LNr6$ErMi8=CjYE9h<` zSo8zp<)~fy&ggtsQ^R+0Cu&d?0Lhf>CLvsx5 zdIqMT#dB{a7CH)$d_Kd$!rm0$R;P+s$G^ z)jjHZ%>8qGzk7%8hh(}F=md6t3@3eqy4g8y;H|?AG*FtWN;_~m_MYV6(uUGlUQ;)= z$`$pa&Fxxcxw=xVl;=;7i*P=%w)Uu0ua@UoWk}-l#=5$-x&CNABbfk0FUeK7tkkON zPNlwG-P#%uWnaxgV*80$Vaud{?YdQR4#K$DE9xQd<<_Ucx9v` zf~Lx1U$VyV^3TIxFM=}#SxQ+k?EoGq9sLZ&rJuswD)qV1I{kD&J)it=q+y%4c*kBN zhj}Ia66Ur?jJ*fb*pOlK&lav73L1u&40#u32M&%ksxrpm?LJ$`Mamc=KZD5e_y|z8 z0i;Y#>eFM2=NT+)Q_a=7=#Ys|%EH!7*C%&54gA=H<4(A)LW?09RFAAjcgt6@L*kkG9p>lE^ zQa-x9uy3C*GYd&^K5W)bVC-iD8@i2$0R$qmb7t*C2?rEkkbW%ysrHZ2?R|c5x6}M! z<7uBCzY$=ejtywL$An*`pV9nH=iuxC6Iv*Ic^+msYCQ5s0Zv7n zM8=NANGfzKcR0I9Kl|0+{`pyEoxH(rVb6nu$-|g3?}W6tdzai!7sy8h>g6NhZ_CM1Y;F{VJG<|O7<)-FEtE(r4(4km4;OY(|G{=m%(C&hNeE7u zo8L~D8-tJ2Bj+Yodj(YdAA3GIJ;(QaQgXuBe;>r&l5VDVZq(s;0b?Va1^>QuKV3Gh zHHLbx5dFXL?2t0E$@}Agm7);kV(jg3^kg6fqsbz2dbD9?^265(Oh4Y&cRwJ-bd8k! zyri9b^0jj1zCaFbnasf;RAb!Mp4dzA5+}+wI>wOnkUi=`#U- zfUgr{a$5p^n5nUgN=?}PFzD-$(AdL9*G|3&qhoj+8Sdb;9wh(xuOR#(lPRx!naQp4 tS7CXXy$Z|a_*GcmDYRzzh<)c){I+#3cuq~cz8?7U$|Zvr(iiXo;5%^ez9j$v literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..6c00b5c31b58d5265337daaff09f3bfa2b2fafc8 GIT binary patch literal 4426 zcmbtYOLNm!6h;mS_#`AmKuA1o5e7^A;MR%Qc({t~YWch(fXg0BQ@A=NT=X~dJ z_0b(`+ky+y3NeVSxTGP~pGfXDku2MEP1V$;dZ*bWwxpVEOVf#+kfhu_sdR5c%IAt3 z=TX!#JGM&FQp+@3I!UU!*=ZyjnxdPnrf%*fcT-8laQ28@vx#cjjRb=RFqAfNEJY>K zN;z|vxJpBDmFfyZsb(okH5Z^%w^GXhs;)SWBr~)M1A}KE;h)v1>zXP#uHxdqi<(o@ z49!Jp?I|AVmef>qhakY<-e$*8UClHkDsazG$>J4>W754BEfZaEOY+SsQ?H;$szt*k zwxQ_N9C1`zvs}|II@dLu)&m0iuW4<}k79&Zk8 zs~ZPzw_grevSY?1xwmvcFr0fgwszhPOR*$5=6aJ9D72y3)bhr~SFirwXYO?2i*U=T95!H2)&%9szUg_kp z_})7)H*a6e50TJKmFIu*ng8<*Fqz{p!4c!n1(;t$AB634D&$cI$u8c82@EtImq#Fz zKh8`cM{u9Kr0PMYM?hu28 zBFYxxyRb0CM#sXMN5qd|y2nWl8asxpSR5I|P)k9*GX{C=)1z6a$uuYM$ zdwlQY;6#sN=A=XD7tb}`l{g!n0(>ra*jHg8R@^`&8Iq?Vqn@r_1%=Ec2{@Vo1$wU1lDsVF38b(&Zxy6fZ=I~zkLS7*r63;#j zPB%=o)24MXL?p(@=~Uq@)Z{$4kY~B77Mu!Hk!BMcIx*BIEdJA}{QuCD55TyhHq1Gl zc3ZKvr>sPFDa#A}>Raeq4+Hu{X6j;J2ykZTG9@+k8QbN2r2T9%HHy?pm~=Yzw&n@& zJ~v9>G)(c6KB>7_%a|{t@lRmJuUuZNMG4-KOY8UZm0Bf_l$J}`d>^T&0g6a_wzz?u zo`U1SQzU*LP7R5xcoFcLklnnSF9qqqvZgm*PC&F+>SoI%9P=L{@dqIKz}+y47vNlg zn=cfK*?5h8FgAM?0Gmx*LbFR zrRT~>iqL6P_qqe+01g4zkf5nN@=5&n1TiTaj`*hl zvjfdgyg3SgV7u4BVjmt-ig(=j&gZ}W{$-?E6)(}d-ZMTT+zKX>t9{eQ!yDoU!#5`V zdBsWg3%!)R(L?+(0^(p37Dw7XxZgkWfv1A_&jLHFrvz|x9zthsWG<4*?vF+-9 zx_35sSWewJ07}RoZ$f-2FZ5Wn6q+JpkAIODUOR)nkRNQjuH~eY$-TWjj{?Dfs&w3K zey6{NJ=JZRc6;ef+qKEdXx8<&II*b={khpz0ey{@yJ L{93&a`vCs|Jr2>( literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..55e0f79adaa37ea13751f357bde46ad795db9962 GIT binary patch literal 3603 zcmb7HPjlN;5JyhaHk;U0)l%FPTGg~e8mJA1=^>>pvZXj4Y|CTI2{4(_$kMYdkoANl z2MUvqz=h!xaOBF38()C~XU+^CfEh0Ad$N_paSipw@6YbO-QWIp_1=fif>8i($~EGX z(29v8_n*u0h{!=mV`@`R?oS2-63R9m2d+oLqAaVr+|mtMQ|rcERE_8)w8@SlimKPD! zKQB9&_;&14UuFurZ5CZTV6hboEe&<$c5wo!Cv zXGr1{Nw%`}V0tVw=MLnp#K)bTb51^y<8VSwpDxQGi6^1|nETBP9H*nh1(+#;d${Wo z[+b>z};XXhlU6C*ED?T~3A|F>2OhdM#(Ac~6*P|6J94Ccn7a6sc2E{^r z3x2r)4_}H((q1aP#(bi}Mk)T5_ggB>RODWV-<& z_6WHaldogx3S0_Cp%sxRFUTufYf=_g`;R?Xa{dB$ z>em$z>wYkaPnC_NKrSgs6r_&p54kJ3@`ITx3!p4=1KLzUx(Qb!YaDpQWNpJ7kud&- zFlRAB(u_o-`>F7XI&S8Xe_#t~x|>!Lh)Ytl!s9z|o%93o{%$a9e^ zzr8dp6z7JqAW^08vj8``&wXtF5qg@Uh)tX26eF>|z>s;u`I!Q%fWVFI5kF0kZb0sc zdXq6RhnDM`PM@bXUem;*A$jytK^zDKj&oS62Q|GRxR*Kt4(_o28qV;gCnaUM?>?axvb89$Ygp+rfzX z&((N5&=_eV=_#x`I7>K`w4wi~+A~%PUxJjR)u0Ae6LvP1+y-2q()4U)u>SP&m66sP z>sM>r{|Jyh+d6K;rqWaEx~a9Qx>|45%wDV8)~fa0x~7V+NUuYFZog4)X-da@?~y1- zufess-Q9*#6*E|o*XK5xy@qlit{^R?xgDk15iej?Up>EW9#q6t=@z^;x24x=rrz## z#f#DdxIedv?rWcz2X$l5+|v|Q>zI{K4NbhXeKZ67O!K%0GSjH;nN3~Q8s@&zsVgmG z4hM9**VW95)-_CJU#T~gN<%{gMA%^KT|;T9N=L=erz=`(Pia*V!YTi()L zc%$2G;%R!ls+l#d#r!-A{U$bmb0STJAB$-@zqhOL-Hh}G+&sVA(t1WmX`nxU32<#e zbxHT(uHG}+J&bS}CEkQPi^Wbe16^1w)NH?xAieM?+%_M5V18U_caanYxV_j)N`MvV z4%}KSlQ3>|`-co<&s3g-q&KvN*51=wpPH)C+?_*y11|Gby~R>In;8c>dY%K|d&XWz z(~!?uSmX0uy~k*rPV4&`Qg^1?t$%`Co#}S9eXS*4O6OX=wr7Z!Q{@(xn8>a)iRsU@ zjxGXTC@%7o6mdNrSHz8UTotqFSQT@rI&!lkUP%vY>%EpLik06pa2p>IOZs6&Jatdu z7tFTs+0*1YGP~x{acM|TzcBD}hmVYti(k-xe0uV?ApDrgsJlO9Hf#KOQRL5y;>q)( zxL^KL>A@}j5%#9;q1C8}-j;ajN{{f%^*Q^5mA;*hj!Pc3`F9%EX2atW@1eND|BwGv z`fw-duJd-={4&`kvGnZ!+D@)XsKUJ9>Ly+!kNX$VKuq6%E4@pinternalAddGeneratedFile( + ' +" +(google/cloud/dialogflow/v2/context.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/struct.proto" +Context +name ( BàA +lifespan_count (BàA0 + +parameters ( 2.google.protobuf.StructBàA:¡êA +!dialogflow.googleapis.com/Context>projects/{project}/agent/sessions/{session}/contexts/{context}fprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}Sprojects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}{projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}" +ListContextsRequest9 +parent ( B)àAúA#!dialogflow.googleapis.com/Context + page_size (BàA + +page_token ( BàA"f +ListContextsResponse5 +contexts ( 2#.google.cloud.dialogflow.v2.Context +next_page_token ( "L +GetContextRequest7 +name ( B)àAúA# +!dialogflow.googleapis.com/Context"Œ +CreateContextRequest9 +parent ( B)àAúA#!dialogflow.googleapis.com/Context9 +context ( 2#.google.cloud.dialogflow.v2.ContextBàA"‡ +UpdateContextRequest9 +context ( 2#.google.cloud.dialogflow.v2.ContextBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"O +DeleteContextRequest7 +name ( B)àAúA# +!dialogflow.googleapis.com/Context"U +DeleteAllContextsRequest9 +parent ( B)àAúA#!dialogflow.googleapis.com/Context2è +Contextsœ + ListContexts/.google.cloud.dialogflow.v2.ListContextsRequest0.google.cloud.dialogflow.v2.ListContextsResponse"¨‚Ó䓘1/v2/{parent=projects/*/agent/sessions/*}/contextsZJH/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZVT/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contextsÚAparent‰ + +GetContext-.google.cloud.dialogflow.v2.GetContextRequest#.google.cloud.dialogflow.v2.Context"¦‚Ó䓘1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJH/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZVT/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}ÚAname½ + CreateContext0.google.cloud.dialogflow.v2.CreateContextRequest#.google.cloud.dialogflow.v2.Context"Ô‚Ó䓼"1/v2/{parent=projects/*/agent/sessions/*}/contexts:contextZS"H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts:contextZH"=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts:contextZ_"T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts:contextÚAparent,contextâ + UpdateContext0.google.cloud.dialogflow.v2.UpdateContextRequest#.google.cloud.dialogflow.v2.Context"ù‚Óä“Ü29/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:contextZ[2P/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}:contextZP2E/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}:contextZg2\\/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}:contextÚAcontext,update_mask‚ + DeleteContext0.google.cloud.dialogflow.v2.DeleteContextRequest.google.protobuf.Empty"¦‚Ó䓘*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/*}ÚAnameŒ +DeleteAllContexts4.google.cloud.dialogflow.v2.DeleteAllContextsRequest.google.protobuf.Empty"¨‚Ó䓘*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ÚAparentxÊAdialogflow.googleapis.comÒAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB• +com.google.cloud.dialogflow.v2B ContextProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' + , 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 0000000000000000000000000000000000000000..e5db6c1c3a2637ad69a8e22d239f96ff9f3e718a GIT binary patch literal 6974 zcmcIpO>7%k9cP>--MoCYFIAg((RMmrcGJ?1x6W38+oYPl zfBpWy|A*f^edZl_=&rm%9O4@xsmXiCa(F;w&v!%DbZvRBS+5gcHrOS0W|VJXKOHw3JkLvQH2)Z6gTeyr2xdL^Aw&%{|*P=PA-&Da#>r=G{XqsnLHOFx&3a%66a%VA}spuz|w=Lp?7n51Gh+SJE2gaf0`WF-3 zBAhk@JK2L0Rgnsin>rA5a5s7>EEzs9$nuPfK+$4F#R5u)M#JmvM8u|tix%gOR;#tB zvJ9TjwUSFy{VqCH(ZdVX6i&0_YE**iSqZ9#+4L>0%J3{GQJQO3i0RwHgE~#9zQ;4l z56lV&e4aM`=rMm38BC~o9crE?hl@Q(5cAG5(BUBHh>9;0#xS!3%BLe}Tx0^ij;_$| zG9$^--00HK7upcsMpL#`C+4wf6P?x|nMuLZ$?P{&=1ecpR8gzC7R#5ZI8$3jH%y@& z#c|FIMV23bp`~7F8T3#{1+xZO2vlgP8PNh~Fy27p-ht~7-Dx)Vh(B`$l#ONQ2X(YW zWj7*G=Hxs=5V0TX6u6n;NLxDA7Ne@R$jgKtp*M(AVWU1_l`2Co@+;cru%d z?e*YhJIo>?fb>35K0uT0*yG#i&9&9#V*bPYT2U`ov`SIm-YA!f`PJpsV&U3X@Dv(b z-Ox*0n=4zza`~EsC(vkqbG@`ytibb>a)7RP*})2WE5Et1Q`{qp$WqYj)<@O#B}|*AAkLo zHkZ^&v`A(v5=qaa>)ndS(9m;o%)^>M!-t05WQ}(;m-?op{CNo7j#uYs8MC4OI+z}! zo3MX`gg(;6{>rnwnFPx@%GGuFWz{fju}s;J+Um0p(#(%#Gf6f@WhJ&QGo4?y+GfzT zhVg=8!017TSX6Q8kD=A}2nFXZ)zO%@XKk9XowsRpC*DK?4nk`MUgO(}@{=JX_eY+W z>vm_k7Lq_cPu>5ySpOjPE7nG5v8JM8-FY3sbeHO-$}Ic)YiL4bWq?0UA>6$t;>Sr| zcc16OC_V6oqx@X@@t^+wv(yXaYxFkhC0j-pTAT0vj_o$rwr=if%A?+5nHDEA$tq5@ zX=d{QR8i|D3;$C>*Sq#Q{C*M|UB_cE5;5!{#mYf>9syIW;=z#FoyQl);#A}7KR%Vv zRL4e%vq|B09FBt>Jo8q2eDr6%koS(CM)yxz@pT>)GTkL~szuiY_`edm(QB{8=iCwW z-Gnc|@Q)b7Lq(0K+UdSXy8y_Vqt~%?|ISJGcb_S_oiLF0>19{_?ne{9d0D?TkDV@7lYI_-P-Rq`+J9XRQ8L3Z?t+b$B5usQz*>CX1I9 z=Lr3UG2>H7sYKz5fFzYdCSbn?qN`y3IWKfCzAsS%5#{@dsuS@X*vzTc)|T<#QfQ{% ze8x|bQ0pfZL;mz~!W{6=7~r2sN;yKM_Zq487(yZx`}~DU=YC4@t||J3G`G*G0j;E8 ze6G#*{cZe5?ZbmG^nzR_b98jX@oKGPMl(EMFLEAw@Jp}m`i%$Y9X~U*^h*i71q~`8 z3rlU+Z?Nu$Zb{l*WS4{Sg)Cf;?z`fxGWZAM|ICoL_eA{XKa%vDRI0H2yHt85dX1#! w>1!ml(0Yxe?qv5yU~LH9`FC5l?GM95UJCC05ty4u>(LM3pTBJXY+B9&&9hDubHR*rXe=3s+Qx#EfU`b+Yzm7YaE!JMX=D?|bii zZ)R@1;ca-}vbcmC%F7idw-SjLQ`LZZBSH!z3YvQfu z^4d#8HE=`UM5@?x-JXpU({{s-(yS)8*vRr>M)m6l+ zXly4lDnnl~Cy4Tn>-7B4aV)2&uXwchCqpSoK7sz$riXXNk2q0Xvq~>QLknmQ{5cD*|0CkUGE6rnSy3D2QL3$N8NiP?=$c3U7 zL_Oi@e&4O7b^?omEzQLQ%)Sm-WOjG)y z2+pMa;LQ=92FGZ#9e7ZLGvH*$3Ow7`X-7+i*tr5Mf$0wKW`r1}V!R^2SHZODBQh-7 z6q(X7vNByO$BxFZ$w_h3V2iL0PFgfrf&z`UbUaei=VHB#I+9c9Fe7)sX`()uB^H6W zG!j76?YbPl-GVS}wNeJlX65uu*3qO^?rc4N=^o0Os z?^r?BK0&Ar-2Ia0sztP*nJnJNf6~D-?zXc6Bog| z;9M5;0ZC8sA7D?sdBH)Ca69Ev#8{~Z#3r&4M*nq6z7fEs50McVk8oqS&$;_?vAE=N4epo)9)`3#Vp4XNBz80OU;HL#p${PuAVH5&+S}_JA zD=uG|kzd+50LV~9Wmi!G$dLTe6}YeQV+edqh?Gmn(L~Bsi$OVpNS`nwsg-}5*FCKP z&hb-ta=49dd~kwh1Ai}o^V!2_G&{0&#suLB1K~?SYD~fgm9_T6y-^h^57wlWOiN?% zB;V?uwtDoaPKMdoL%sZHPn*d-yZ@-Yvw^V}sEV?^z0K*F9PEt{Z?LzlYvg)_yRN@k zJxYAARsAagyh!c`BS>E_9fp@YinZvAQcHMnll95??nf>fJvaTPM%*ORVX&XKzL5Us z4?+04P-x!%woqP*9@69neMpm=$wQiazqURVRr4!z$&)~py*Z_xsOa_9GBcj1B1!g) J)CYY4{svrVCXN6A literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..706dd9507cb4608df505c984a43f23f8f49b1be5 GIT binary patch literal 1358 zcmbVMO>fgc6s*$})NKX9Ei|nJTG~oYC2*wlmeN8#HmN1zM7A3QvSe+XO=`*YTI+SH zf_mUzATCH8`Gp)=+xbEX2$56l-I+IUJny}F9b5(A05*wF80Mr8d$*8Z5g0JasY5;3 ziv|P2phK?%*CR}Uu-=AR+k~jDn$HC^q!DvS84f8OdZg%hH0l@oF81hf;L)4ns8n>Q zKO!u|+@-!vM#Sez!ViFtuSpnShrnj1+9DkHF~?Rjp|WZ*l~tcoS>4hp0FH;l5Z2}> zQOpQF0VsY!)bm^ihFlbL;GrAZuJ3X|;eHg&oxuV2LLyie?+zm0i3P$K(DoftIEE=_ zeD^S*!i+OG(bkFm5#Cs;&k6IfXVppQFgM_ob;Q+jc}V!w)%Z=}cw9E7a|f`HYAlx* zM4my;A~IhcLPmJR{L@5tOmH{-XZ@RVRtGa-i5p;_m&>yrXOzo`^uVzU;bjyq$0WAA zJa@+?RQmmC&kYfm!c=9f`3QVj11JBH6L~KMDM`4LS-6x@X>Vst$O5MrTN;IFxb{D< zf=3H6k+;F-d>r!rvd#XA{7|1hAx4rIkW1R`$P2Ae)rk208P62icdJ z(Lpt}p`vr&HEtu5+Qs&A2vbiJ+Tvek8Pf812{ zn*^ST)$y06s!tXSO=hbjeK=1&n0yO*T^!Q+&4L40ESFgtg5K%;!%s>2p2^f3KQepG tWT7a@LQ!T5Md_A$_mWL?ax_iqi*)+thBf}8uCruNlbh)P-GMs*egUn#v^f9( literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..cad9696714f6926f6a968c1830490f198145ff42 GIT binary patch literal 9183 zcmcgyO>7%k9p7=jnwPelzHXD$Rl{_)t7b!MgG<@P-E0|uBzWaG*~F=oVreuPKRW~C znPFy}G+PCsmEgGI-YbBZ|0px=DrDD=hu*qEZISAe(#8P_7QJdhGQs(#_#nz9c1x}(KA&ISvj7s zZ19bZCSR@8nzt~iZS*Y#75T1VbTyP$G^5|nw^dm)x*g3p%pVl;ilHAM%a$G0(50Ty zMp};Y2SAs5$TnpK@oSrzrx*^ygolvS%tShXrXtJdSfLjV*_wr#!~V!2K@f@gro ze`bGAQx)EJurP(ct=f{Rs}5$Net?Zz;XATsBg`ebx6{`Zq99KQHgp9oy~#74WbbX$ zz+kNKo^G22AB;__raQ>eWvx{~wqmKKV_2JbYq8ixj*lw&W$8^rx`o^bIL+@IBU03yPYr`aQJDQQc?=W)Jp6MK&U16WJsp7zOfyQ&);V!Q3f!YWRqCEt6*mv_KNUk3Njkv}lYh;lUPazWDN4hq?Mm!WK`I4Oxs zS<+=c6I$pHze#(pH_;r&Ig&>N-OgiD!37%zuu3`Ke}rlbJ^~j=<*|`tFO2hJm}JQ#iNQ8k)6Kq9VFXO<8kivYj25P_ zz{`dEY19$xa@&NIX>tu*(qz5cm%B((aA8}xN-ge!Te5{qnua91-|gbq^J}TpbL-~9 z1!` zIPlp}lCqe@`Dy2Hd(B6}0&d_W`5ICjJO9l6bez`=h1I+KGw@V*q<(k!^#BaPM%2H_9m;6_C0>Vd5FsfK6GSq|30737oQsMkAccVUu-+TFBZ z4rF09Fb&Bd?wl3ieQ@^6jzcE+at!xln0f(+w|XDX9D9k9 zO4DEpS1^LM@WXL18yLo%da5>$ou@W`6~M4--S{FsW2Uf@=Gj42a)GOvZrI5Zc#Sb9 z6S85GqD{khoU(s3I{Px?;|a(ffZ0K@uneHA;o(|SZAWSwO23EOJL`?5)}0sPZ6G9v zQpMd5Z-UvL{1g{@yRSJ|?>^>1P??}DE&CKeD)^K_{}<7vd2o%@8rwvQ+EEo3RpBwX z81B7r6->E(+qM1yo&jEnd2lb;evGVt8gYBL@C+=bcShV7uR4~D=V-m_Hbn=w3_4$2 zF1(fI=CC|kU~}|8={U4t2@aSKJWSWTew-wg)W(;U`Z0%_aL}t+2I3YLiY&#zK;c1z zVw-`R;F4pQ5S>iJ6`TXpCYcOve4Gt(m4ovD(BB>7>qw_T zNjnQCd>dnvB*!-K*$~0^z*Qye1d4@?u_j~iXkcJHUe(c4M+zxJXLI2`SgaroIVfVV zXKxHfl*rVKqfv++0Debr(tvj(G2h{ i3!OT#6)4wk@T z)WLKhVS}3I>(Q!MU|X`+|AN&_$jpG;19p8N;8$oVe+!;-DpJ7BRIA-=Kd;d&i$BgJ z8tC6l_{Ds%+OeX;PPDt;`H`f{<-&VuH8lazh(LC%g!vIq#DYEKm=-!fapY9Cy;Ck% zs}*`k3l3UiWT`AR%GEkKca4+tocq;3p*6R}T7!I>6b`{sB|d2*c17Ao7|4;WJp#*# z_2N?&O>K@Xil4IJPcop85Jf>=Ms;{&SW2;2j*oLP5KlwpbeuQO5$7oyo;TvVLn3|_ zkDZNLvnJMSPe{0OSsL=?fb!HaMD zzyso5d&a)=YYJHGG(8NkSfVom_B#gH2g2uRT^S7gaA8;{w~{ymj*D#SFLKLIO2SGk z-Oz*yc%-8jYg@G1{5}J&Cr%ge9j`pcJ!42DJ0pT848d;-_hXTWN3idnoCt;$;ZZE* za129SPQ-Fj4308({UQSv<7#j)3qUaq%ye20(bN_YY1@Hp;kyj$4>|aDEM#$DpSlpm zHGUOVVrhrLJ;2AS_`l5nKDGo0YTK}!hS@M`54Fn6F>(9B_Xi-1*7!IOkHgmc5JqW- zfq05f&@KL)0k;xHtN=!s3cyfu55^%K#7*a#z@p?OO~m>AT)fSg#7tSC%YhT|{q(0i z=Qv1YpPq=<6EA50DDLh%j%gS3`NP9QH@N(#WOCoxXD^xDBac!#hSj?}Yd!LS zHTs52u1wx=$yNL}Tyl>Kdy{zlc8vRX{8t3-ve!XEZ;y~C&8iaf<_O)%-tagE#{m2n DY-(pv literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..25dce3071af6499a2086e99e494f268f275d061e GIT binary patch literal 11256 zcmeHNPi!1l8E4mVYk!U%=f#fKo21=rTIEme-LjzwoVsD`wH*`xtJnRLU^E)fzFki; zo*8Cl?K;5{6i#pe2?>b{LZDs{H;xFwp+Z%}32r%Y;DExRy@4u__}-tHowaAS>y?o> zkV9VTc8$oHJ?^yqa5C-N?IwOBPY)2`P{d#|`#D(beiOI=U% z4ck(Ya}7BaxC8)8+o7JL=`^>nHnU89t*ZIj<^pH7Im?)BmP2NnZwBNO8h8aSP+X{JY!&(XEDhNUwlbBtis(&@G9 zIl+^yeaW%WA=9})JCy3%=%39+%criTnVV(m>8|1Uw!4N)r>5%E4?WACT)QsCGImBS zcTMOxHFZSE>74I2XjFPG=Tg7nTDQ2~jKM+p+h&aK6vx<9EX!tIuq|(Ds%cY`MH1nx zX;8~Q9?iT#&FT!@)^-isJs#;gl_=_1$rxm8DvhdPBP?o0y>sz#jMg+4kz+X8aa^!u zTXnZ#S%y{LTy@xPI-c7@G?g2IwsRXoQiQ?Wj^polLCT}Ita%T+pxrQV5Bu7V6Hm+c z&Ey+~+$Bo28g7bt%mmj$7&A~`g`cdzYh5K1k`-hHo`VX_98}mXWyd5-%`q@XF?5Rz zlzlPsqQ)SsZb=Nw1>=zgt^}%lH7Q?lfrpZw#?Yu@>O(ln zaEfL2Oe&YU)=$Rabk*=2Q`=Yh(=>ZJ)AJW4O}+pFx=XS2sEl=H0N)IhvIU{G5P~VT z5JHSm^)RZ2gOx&3o$ick4bE!~-`-(`PSxs&0U4i64`=XdAT|a-1tp+V7@zMWe&7S9cuD9c}Bq$_{ufxk0-BU4% zco-Fx?y|_lY1r45hBE-3ABMXBvw2h;O7-mxdxO3g1bP$(P0gw|n0~rlr5Qjr{p2k4 zGuWz+Y>Q@w_@gB_>ruVo8vefOQQt?$c$q==YUcBwDg~H`jphpmpVLb!P9qtr9y!xT)m5q`9vB5&Zne?WELD?XOL z9keuaYohPM*9f5_E#3jC#L%0zKpheVzaEQe{s$>|aS68>S{8~76j`U=XkaNKbMPD{ zRD_X8Kr^pls`*qYl4IJB;dNNVnL9HqY4s8Uz#sYcLu&E7(Vzc*3UbLBc@DN;l&rvL zoRd7%um@9Kv0YGOOeJG*#zK6m5p8%{%~#>l0*&)d;GEfLZVp^?OlahPi#E^l#2uqt zAnAm{unr?}uHz9ozUO$|$^Q!Ve~XupHu@(CW>u|A!I9F%>a4WkXu%8nF`;f9a%E~# zpSIEVMB@6L6pX}{x-UX6ZiR41ZC>SD>N32ToKh6Fp4@~14>LPaF_veb?TaK{Y6 z4^f4n?Pd0+^4}hT@#M;wP{0`e2TI2+U^{RrT4udQy^bk_sf(b)=1pomA7~uc93-k* zsD$h=a>$K5fGoADYQv+hdQ_HZ7*0x-31dM~)$n|}kKIXNlxQFBc4ySGsMLz&DJ;w0 zf$^rb8?J$Vbi+b60;ero^>#GV^fmJ#&&z!T%c^ae`)c43z8(6qe>??aO;+>R9yVNt zeCEGJAQ89K#Jh|zXR@6+M;MZq;S#m9Ei-62wlohL!zOng`99*qh2}HW7lt)!JL?1n zN~`TecLI;Y4%6T?)-rcL2$<;3x(ry;_BR<%=}HI2^+*v_cd)TB19_s0Tkg&*6cEWdx@6PAQw^A@#we`jhYtUQt5UE!^Nj=I^P^${xO~F{R;9l6kl=&&a^^J^rrnYMPBN!!{*hd=cSXw zvr7xt>;{~R2_Kn;{s2A!?;D)=OOQ`y9dOF7!e}`z9;DmeB)bcvv3??#5a_P$sKKFI zmQkj4>RKPU0vGt}UBmSonkkR};Ucyh`f%!TmM=1P-Qa91H~h>{kle*K&OU-M)FU=! z-iBVDm$~HrnO8qmCgGK2XB}ZfUV!r~Z;eomek3JU8=L~ z?%{t7*DP5#unlB3_GULXVKlZIAUVhc#ntlJVHm;aYJ9vdsyw+2<8lS#jmKz|60|8I zG3Gz)fw5-sY@K3k0WpnTs^Un@Yc^}5H7|FT16mjsmXO;TXNLa3Rs$1W11@@+Nxhnl z-#An*jyJ(U!4he&!-~-=trGHOa(Sy9h|LyZ_^>kM0t{(7cfD#gcDAT10l}tdSu7Ld zi3~9>ow41zW*LvfyvL|UXh{|ZtJE>=eI5XO$BdHGx%1G!)$o0EFFt4KRX#_K*s?h` z&UDo(4%7^br$F&`<_ru9FJX_nYv?rpyA+U^(a|9E`nF@}LL0IHLvjbH=x?0TaZQFw zueS^4QMLt%$9c{pUxvY!2MFox@?52&EX=9%tLw|khWge@Wo>SDaei^GJp4J*54~&a zs~fAsDbfe0zFJvb8BXVK!eHyn3d?!`USHE6R$UCDtIA23MDGVFINPkTvMnHAfm8mz zBSxb`rS`*|@bDms3mZt8Ux8EXCmDg^jeBczhx9)WL|NZhoL!nzD{n0<%vClP(S#Iv z9(v}LH;2>Y3=CA3af!M_|+LU_`^EfnvK`?R#&IqMD}887Ckf;XR<=d!@t6Y}FTo8XgY*n20==G%Kd zku321`5+5mJ`!Vce!nBwu{Q)#JM`rJsT%^5hu3%Do?yrRtp~Eny#kpI^o<*mC({My zUJA$~cOD91Va@+N&3EV@Qu%ihW8XpMn(`8R-Ko@#``dZFBkmn|t-YkDN^I(Qs@#sn z+~Ll8BBmWgLOi%WQD)+AWgM%``=kdhwrhCE?I2ol!EQ&{VYojQ;eL|J-|HwKQLjZ4 zh~B1~X90hZrycR{B;cPRD>3BLQRTxl(@DtL3E+uRjt}_pI@auaPn7Y*(bAukd)vP6 zcvHpV-rk;!eK`Nai#6Ng^5-Pp^YPgMe&Vy1H$~0-EDbN<6^J&7n#s&YGO>&={_yR! z)crRE1m&$Ec9)`VNAF{yn%LYm;J^tu!wx6D_oOFFj-x8+_EJah zd*A!M-}`;v`|0WJTlOOxy(!j-NgT~1J#lMS^d1q>b}Y~8T86ka+}ZV;y= zinR@~vC$Tl+FJXIFx9n&PM1{0zGd|dQtleouvhNsnql>~4Qr?Tq*Cr#-Qj?kUWs`{ z$kYbJwY4r0>&@jm#M643r*-PgL1%?J=+r_7o%@yR2z3q3b;VlX2t7k0{IiE!hTauj zPxIiv1>IG3Q}669F!LrnyzAY~LF;=Vlg1jMm&X7b` z7e$A7L&v<%;-(Jv!e5;UfXTMrkxkR0C|IUjt&VaUxj1OzilM{C9B$64PK@3%d89qj zE$47kTO^=M>L4f3p;PZ3BFlBl>^no#)Xjcp!=@}h97^Hl1N6$k_IA@}98P73-O=2~ zN0{5zp;$a^V5gtkvb&v4pu_M0m>9p`x~T_jmV3RBysJ>;iy_@8`7WWqT}78uS2r&D zrX|)0N~1z!ltv7_y%!BAla9-oBAZy-!eZOb64HuNmjA%>;(3V9gK`8l=G83T?S*9*o}ACbaI zFv(ZGk}Ap;^XhY*dd=cBlp6#mO5p_Ln@^c9KZX?3b9VgzZ=z`$5-H3=M01s;R1wiw z7+%?8r-M#L1H_AHiZX(2Y`#+D{y1GqVX0#Y9S_i;JDsm!ZVSvQ`RNwRXf_r!&ZF#O zvg^|Z&!XuknlU5=MwM#jnjn2oK(n!J#TQWV-NweZ)|FaaQQHriih8fH*;H26R@ao; z{4sn2Wmo09^8!$ER(Y@8l2_Vm_Z9W7JWqLt@73$dW_xX;F`vbsM+LdA zG}`K_yt3A)tDASgOl>L6^#}7)QWs4#gn%`tH`{W1e8rO}x6)GNHq3-&5jyTK3G2bg zy=KiH$wGQFEoFT}u2I7&I#^TI6*g_U`bXiP^6v#CMVgOKdFVTC38YM!(;U|U{BM)4 z=a!!ZzxK*u*(_@=fr0REbqgNsg>nXldVwI>!=26qPlna?kDKx{{_|+=mvcY}CbXmm z!gb>D1X|=fLntA9E!H!Zpj`haFQh?0`k{c%tm|&*(d90y=(w#pQ0+k@3Y_9Ju%1RU zwg!F21trE9IE`U5*(1+-OiaH~;W>1CTQ@*cL2H6$BI)StSSYRyl7`@~qZtmh3*peR zUf?A$;h+iI7(RzindGUbMwVs;A^k`|XIC5o#X1hN#KFJ+GJdFSs#R6-a@B&TB-+UBJJC33t!S*nJimq zaYdaatJ3JYL)WtgYS_9dA94}a|6m_B+*|wr4A0CAo^SwWUhM#EMb4HiBjN2N94BXA ziZ$)Sckx^3T--4fY)~Z&D7T|IRO#{}nQ(4MchT7zG01-6AH9dX55;uPhPSwV#S|?F zx;KX@2>ex)A2P2h6~x@L5h{s6)F$L@G#A2~r>j7y(TW(iOnol7a0%v9W$ z&;@s(IUdm5b+tb16Z9pAzObr(o=j8u@+iXne?vmb(`aAdE&AvQDd-d}yB?e!y2;L{ z0NzBE1DyfheEAH>{dM#?!Xi_*hlUYqK#ETeUrd?qEXqgXkoxGHpKbWI#w!M|qk_L2 z>9MX6nHGquLxeAVk^%X{W$ymPnq2---p*CtPAc_--7vN03qt5rb8#&Z9E0zn^8t$C z8%ewq<||i|RzCo)caBNRFOge$bfT#=n1~WUKb~maYc!~$%HSNDs%q{Cj}fc4ai(fRQzKz{Dvp}R`~v3{_#QPV*yv_J<~H^uiOZg z*wVO`TZ*W+hqv*~17>lt=9ZH^RPnU~Jb?Hyy`WGJ7A!|IMJexMahLoQd0VxW2&Q zjobv3!s?fPoMDvulOP>|Qq@rXJ^ZHhisXv;s!2zt*~rTa`IKKCSGbgWE?>&VdU$% z{I!GiRuW`?1+vCvRx(-RwkZMo4=?H^pRD7>H4ay-tRCK8@+mq#D+#2yhw73~%yAFt zi~6~I6`c+4qo8fGYxWYmX2nV9{v?a$;({|7-MDQ^bU*f6!M}vcbw(#%H>L4(6JZ`z z;KR*IJ=sxeHI5^d)D;O{|un_r63n($J3E0&2yYDG68n+=aq}&D z{jqI1gDWpHA1$@~p@1&H#Us}q6Yi{*XZfx*X&-C~4{!Qb{I(vhE&EpV%PPc1Kdy#f zO6{%d(LX*Fgr8?Jwbfr_igosBwX{M%t(I!xgwp-W)^XN#uU-nj`CRcoNJhS2(wk_# RJK@_Uv-H0)?x8(|{tstPO-TR% literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..7a15bed7fad2aba1c3a0f09efc655d9d51131e16 GIT binary patch literal 7509 zcmdT}O>7%g5bioZv@b15w{3o0+AiCwO+#uU7bta`(oO7y&?GiZQqjo5THDXg(#`I6 zciq;l%%MmiA#ni-^$Z6jB)EZu)Eft+ax16@3keRKIQE1P2j0)_`gzw*Hb1IFFOA>M z%$xb z$!pLu1D5|n$329<$37G=-fPnrP)q<)N z1YqP1Q_2;sqs-N9V3MqYZhkgRw6p&Sdt9|6)q+L zt#UFbBX!Z$yFX+bYW|$MW(LMYK*jrL8LzQcJvKqmwlU;vE5&jbB zzM*KP;V!iFeBz}T-J~6Iv8MUh6{JG-SHJv5QY$CG5Y*&?3iIXa-Mcm9scp)n2@XGp zyxdKsqGv%bRpNQjb4ymM4t6xkLtwX6({!!2W(`M>CloyKEzpgT;17a_R!%O;+cn>;T8_1AEA?x!J{~fe7CZ`pD0#>6!F9*?}(cI@lk8fj7H2aH`T0yL?c3)VINVMsm7bQC=avSzrb*pk4`Z{2f>kB(+NEFCm zAnAC((4_M|=zBjsq_vY)Wi8qdhBOzTK6(M)web=_xZ{r_>_&r{6c5G~?UH)w`4I~Fu5E2jv^ zk%v9ptec4p=udkurG!!2n|z5UBcQKo(c(XffPUYMq25kep*pLpn$|8gDtM z@QC#LT4q20@_I3~h`K0*Jb#EEwg!&-M<8rA>iAgQ3*0Xp2-~OFkjNWKL*lWfFX(S0 zV1VgSHGJsg*UhD0db6QFq@lkrhR=DDJ;|)3#H|sa#R@{hAptX+8j=uP^a1t*0*vX3 zAprABZx*nhC}5v+2^u%!aLmtz;QPZ^y(R9IY(gUCv!0cW7}a92A+gzMNF$78A9jy9 zFu*j|5ZL*pUF-(k%Jj~Anus+!`taQii!|K^-NW;NiL@t%AM^YRd z^20{>&v!!eX#^Y~iD0@nI@|ECxiss@&{lU z^lfpjgP8zReY3BV$%fR=qKo!yNJo4tt<7sYpfeL79O$hI&k}UH^Nxbg$DZ&e5h`X@WVbg$@lj_IDs=4scN%k=%DA&D&AYk9i7UCu}EJd#E_-hMuouCLm* zVI|}7+qZ8!t;f3>MYr3l^b6k^bb)S{b#rZeBk|@|lMgs>6y30{)6gcFSE(%i;Fjf9 zF44y4&M$OBThZAMjL19mX42foC|qEF{LOJ+L?Wr_uOrbJ@_8{fg+DLGQr_pq*tJBV fmkhVFr@XH%B+4b8TZk zx9h4%6Pkp$aDfAGLE^w+e*hAH0&qZr+fF-h;>-ai4!j?B;>50-Zo4e5zu)ise!kz& z_w%0LyYE?T3tSXekb!I&BURkm6LA}fmTh8FF?DgvZ8niDD(1GO>ByEuv9vC(t=GhI zX|;BNxH_h5E2tp0OtYnIhL#- zaiy|&8(~?Mv0PtaG3rY+M!nRHQQyeV1EA=#B}OINo_A#Cc(cT`dL+INk}>Bs|H54 zA?x)Laui#$uxVF_X`#?UxLZj2m+8yivNW956sLKPg+eIF1rggW3a&1SHo~rL%(J{{ zfKK;UJ)&ksOREFlCx!yq@X@*WR zf)Vwit7_(wX*9Lg@XJR9T6XoOrt6fR!w2fJf%KxhZQ;G=aAhUDEj#y~!?&i90mAaO z746H&J9}O8s9IFjE;Eb>-pt^1OvzD@e(S@^iR7T9kNH^@F30jYp+!Etbm3Se3gh3S)v$*096OoNo_ z$qAX?bi#ilz#HHdxkZZD*g>{K-zC|*%TJ5Kv*JZ?Ay9k{gVf!Th+yY7xC1PL5vn{W zeT;aH=4T~t7u7r|kfv0nPCUJ9Amv&_qfvumOOKF1seHx{A0dKAQjNIQ%qnxNdVVynKmerzO-!F)vFcNC!2(0hVr0u; zgyDk|V7yu@*2;~$Yt>45X?1zETpD``roi!PZM{+<4+4F-wO%Z(uC0tE=);}6Yisl& zS$Hh`Rs2B!Zywx*KtrqvOSulYNc}pkl?dum~=m}o*Dwr@`Y`M6>=M5Q(sghnYu8!t&an)aEj!d!3 zo*NCCfak%uLqv=$OphOpHnQ;pM(`27s0+?Gdj>g?IAk~XNyI1JA#_d>7T%6qI0~&) z?MCF};+u$5Hn6?Nmd)7UT$~Z1K=K~iQBH&5JEUDeIVton@$-C3wq(ykvpjBjPdgYx2fc+ht_mD3v zbi%SWNQZNAEON3yB$-nIemW#2+J^Y?3xI-?;8laNEU+?@yKD_ite_x%AO3uwUi#pN z9J=gJ0!S~}i0~_rg&+DwD@&v(Pz;X(L)U^2!C5dGh|$ngPvYr>WPc{v-(}Jpk^R8x zbU!&lC-~|;X{TG7hafEN-NTCSRiBb|a=>rsrmRwhS8cgTw82mts^%!Ntu~alY_yQW z&~OpSehAVfq@&1IyjYjN5Wu;9_S_`HWZHX&b$Un|!6VPmzXE`Po_XoO*9K;pbU6v% z2gk{D+Zw4>f{oL)I28#;CHuA~UP*W^JYW3CKv&ABV1(I{eQ)4g!A>J2z3@Q<=0Hke z6U4WF8ZLJG&;NP~oC;*=z`q4BHmE4@Y8=QxYp;))*vf>RxM*eFPyhJy%S02-&=1mm zE~X3Jjdh0a!kxZtcykWEbAYwK=Q_Da&nHDsuHh2_jP|njJ|KRW*JIR3ANJO_b#hec_yhY^R%nNA;w%@6X6jOB4*4y8h0NcbD!MM&o3 z>k=~e>vGy37c#8u{zYP++dk80I0uHpy*W3-D>i6-C_MNmF?crd<$TW1FX|Jff1LX_ zq>L2j84yp;E&Gu7{Q`@a;=9QdX4d-0<-#+Fma z<#u;>J#gKRQQ5_9emgj8=`wDb_V$&-%zH~Mej|YM+au`QXDpg7AGJQCfbS$gHrtNok4RO-iNi-K4aU-+Gx*^XgRh cQsoN2&I{cB(eH0fiMaV=mi&gU13Ccw4>z@LNB{r; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d9633a5b8ddf0d4f82641eee87990b9552679056 GIT binary patch literal 2908 zcmb7G&vV;E6t0}4P1kL4R62EhfF*=U3W+qR?F>~&J8~SS8S=x^xP@jkV`OP%FOel7 ztzy!QFPu1VDLwVd3AplKaD-cX;lPQ%fZ@dMN|qJuq>e9^t@plt?|a{S`#yc(w|($F z+(0f041z4!Jc6W+pdWa|Gd%}3Bilv+G`)_G9TZ3qR(9deZXK>yHtX+E*U*as6REJ} zc`XOYrsGAHY+=LkTDIeL)lC~yr&ub|Kjuur_8Mom?GRMkOF z1BlZc*Bnf1b3UIcMvhfRZQ~Go!TDStp+q!e2bpruPu(`cgV87Qnl0bQNrg1aN()k@ z@?A_RWP~n&=LN8I9^Hzi*jnN$mj)`A4wcf)1j+C*?E*$O=HrgOm zCpr{{>L8w}`XTc~5$DMASAnPbgP_E*X9Op`Ib}5~(ET0d0nh&|jI+5of%i(gnL%30 zXsGnfZ`$msP5Qg`v`vT~sinternalAddGeneratedFile( + ' +ž +$google/cloud/dialogflow/v2/gcs.protogoogle.cloud.dialogflow.v2" + +GcsSources +uris ( BàA" +GcsDestination +uri ( B‘ +com.google.cloud.dialogflow.v2BGcsProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' + , 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..3f2efe820e73 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' + , 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 0000000000000000000000000000000000000000..f7c9f4f8346b04c709d395dfef0c00af1451101e GIT binary patch literal 12742 zcmds8OKcn06)ma%r9{zBvQ3ShgrSqzF&wg?^KsQFPH&iU38BO?uyZ^W#S{M{+jx z#uVq>`|ju5&%1B<=39-e2AoSQD7w;=Ev25Q?j@`(CDCXamQgdbM76cCp)?aUW2d2N zN;8#6%#{+$rAi_{SExLTq^8ko)|A=AreSPqO1h>Qt$Mny%9^pcp&9qmyP34ATZ(R_ z7*7CQ-cihkTvHMY&$;C5w=!1&YMN}Ci2`E-4iObvlXSf{%;by-`VQ_NaZZCFOLj7w){Hxlv7xSux^7S_7`iz->*?gNIEXN(spytqH1n#W z)w9Z$ysH|`V5BRG4VAuy>;Z=LoPmD$Fo4uWL*Hz+bY0aq*GmnG@?e&70f6Su?=-Bv z{0s1nqzI2_&7lo!+ue(T`$7sFaVuvE>JpAZASU=xqoDzXA zOtFAYc>$f;%?PJ$CUQf?fTt+p!7V)Fd$2*FB2{gy*b8QS3z{|{>_->uN4+vgjeFf* zdCp#`d9FtFz<73w_up_8rLhg{elbdkN{Y$v(N{J@_k|9S<6c{(B| zV320CcqkFNFqR$oyBH!fFkV;9h9>Vx>`~Zx6ec%d;+|67GK_7BrUfNFjL)K(bc%1+ z%i1ZvQR+6QTcu=tpOY}!Xkr|y)?R!7`3&)|;}F4ghzU@u%C+tIAU+v&pX_K7$|hGe zr5>O1o;(9YQ+E|f-b80gTe4m^Ha6nZ-h#6*spxe~vIsSq<F; zZ!i7C{{)jU0}wejLF45m@IJ;&SHHXgu1dJw=_#ac^g<06bXT7Z5YiRGd_u2 zqnXS7b4`_PTF(9jm}we@C2bfQmiAVI!2$8YP#$v(K0waF88iq*QqPqq=t}Y~Om{w2 z^$jCVnCh?gA>_O*1~+E`iK&Q_EDE5~4)aF$Z|rA$b)Bsa|9nVwF4PytKBwTF&PR z^M(9e>>DHkBl&m5rE)PJ3y~O%R`U2+tmI>1Av_uq9)(~Gh2ufcVeaW(`H-M=yRz0& z{L%?9;lP(aqvF}xJP&c7o-~Vj8Ft89b_&LJFn!6`pY5^iYUjRb7{P3hHJ~jm;kTG8 zHPy5*FFAQq_{BvSvEz!o&EZg>bjYF% z6CbqH+BU{?1IsOUXe9G`09H3C{R$^Xj;K{lZgTer(<+B#$N(+WkoPo0uE(kIBbn2V zFiuTP@y-R;-h!B^?ld&T%}LY;lxWr=>d|F5b zR%9GpuJ6NiwQ1bL^5Zhc5B2yd#`;+2J*#Q5i@I%*Iw29%aKh2m1aeajn+q^Kk zb`)%IdGmrPH_q4viLNC|&l(1uhWtC&nAwHXZt#v=bA=hq%9u!KpJ^w3r>7F$h9Q>XE+|jrx{rx_3k*Acf4U_FG zP3(KRvtfuS93zlJzmucey!*?L>)wer$dXO$^&5&#BSErH0@TBiOyL-trf_heuQgSX9elX4&%#98 zx7Z*JxZx)x0KAml!xdrSTM+S9n55KRe>fn5>6vXPZ#OZ7b!uxjj z;2OrZj;Y{=L|FJF4B%CZ9*Ts>GJ?cX@N_}*La>tVaZVMG1rwb3(}pjS{)DN9F2d?J z$j%8=?qEfV7bnWZIV*%cjXb4kM~zluLq41p`TNr+5)i^~@qB^_%U3YTiep6X`0D|{ z+Rn){r0{=au{SU?vwp>K9);?*vgZ}MFvHEBZs>b96zvlAlR+5wmuFH1;N_kjmne#& zfs%utS;}cg*_Y0#Fob*9Ern72HnwO^Y}^Ro)`PbxF`mL_A((30o`2tQ_Ugd0i}Dcb zBIV|$BJtA+4Yi}Dcx-v{7?n8uVdu$Xu$h7g8zJH7pw-ma(PAt+Vwa(04oDYPqz$nwOUFRzj3|oLa_)2NoxT3>a;fs({$Q`LzA=m6q?}zvpk;rB%(iVDN$~v zR4(JlXaKusk}a;StmNmUteCs8uu@uEo{J3%pNC=0J%D*2V2wyy`S)cjxAGn*PvNor z1YT;kc614+6nJA`(P0WdZ3JmbbBssXWx>3Ir@ldYR7G&nJ}AiX(KW`3agX!z^~}Rh zsAv8%1hG!RNfd^+6uFKe!L8qf=`FlaxR3WOvL@m5a8uvGsT(`!L^GuTpzqu&wdnE{ z9kv|RRha7Wj64U4#nMXQF2YqTN@B6Fu)Ku0?LZ*{u9z3+3d;)!M1bKOF3GPT631~w zxgr*d^vQtmA&mQtjKy!Lrf8apYEx%j380wECx;BUx9HeX-Broo>^fvi%2u7VDJ0`$sI#Zo5tt@q@iQ3GIxqP-%y1@f(wTKaAtC=t6F%p+B;znTL zM&U+mkcQ;y4IJXeh6u(f8X+GWreEGFWYIb!7-c7TURae%%hE!rw19KnQOuB&{Ij$u zE-#eUDyy+bb__;#_$7mI8%X!iot*8SxQq8FGYv=R>=i@>2$xlN- z=(&jRY_2FDwD816@WK)A8E7c7K+Rsj%ZD$;Bze5-2u@AbH(Mw#PPpoP4sFlW-^Qy# zCbzV!D);Qt_QK75vUZyDQ)?yI-S8cemR$H%$k zG7jRIBu+>sA1?(t4U;+@&-ixYaQZdox&_6yp<}|={C7Z(0sCVS8@ra=J24}spAo$m;5vgGg;ZH zZTSuNL~=sRj{7R*&gRC+lc1LJI01{_aE&5N4w=?pH2(6NFy&Jw{SW{xoF!%nyVo;Ik`UhUAmBegh?$g-C&U zl&N~8RD1C)0M3J^esTs*<9UO2W48+V+a1Lj?~nZt=huqGSSa&(3`RHylYAD2h_48c z)M23VEwpo^aOmqYZR@!slV63t`_sL-;(s z?jRof;_0?9u-g;7bK4h%UQc-A@<=SftB1T@*~=n!`9EcoxjyD^w2-#kPAMHR3WO%;O@eJ?s*cYR1<~1LQX*k(w8-{;!fXRdpABi&up0Ym??`&CC!<internalAddGeneratedFile( + ' +Þ +/google/cloud/dialogflow/v2/knowledge_base.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"ü + KnowledgeBase +name (  + display_name ( BàA + language_code ( :ªêA¦ +\'dialogflow.googleapis.com/KnowledgeBase2projects/{project}/knowledgeBases/{knowledge_base}Gprojects/{project}/locations/{location}/knowledgeBases/{knowledge_base}"“ +ListKnowledgeBasesRequest? +parent ( B/àAúA)\'dialogflow.googleapis.com/KnowledgeBase + page_size ( + +page_token (  +filter ( "y +ListKnowledgeBasesResponseB +knowledge_bases ( 2).google.cloud.dialogflow.v2.KnowledgeBase +next_page_token ( "X +GetKnowledgeBaseRequest= +name ( B/àAúA) +\'dialogflow.googleapis.com/KnowledgeBase"¥ +CreateKnowledgeBaseRequest? +parent ( B/àAúA)\'dialogflow.googleapis.com/KnowledgeBaseF +knowledge_base ( 2).google.cloud.dialogflow.v2.KnowledgeBaseBàA"o +DeleteKnowledgeBaseRequest= +name ( B/àAúA) +\'dialogflow.googleapis.com/KnowledgeBase +force (BàA"š +UpdateKnowledgeBaseRequestF +knowledge_base ( 2).google.cloud.dialogflow.v2.KnowledgeBaseBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA2´ +KnowledgeBases¤ +ListKnowledgeBases5.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest6.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse"ž‚Óä“Ž&/v2/{parent=projects/*}/knowledgeBasesZ42/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.,/v2/{parent=projects/*/agent}/knowledgeBasesÚAparent‘ +GetKnowledgeBase3.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"œ‚Óä“Ž&/v2/{name=projects/*/knowledgeBases/*}Z42/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.,/v2/{name=projects/*/agent/knowledgeBases/*}ÚAnameØ +CreateKnowledgeBase6.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"Ý‚Ó䓾"&/v2/{parent=projects/*}/knowledgeBases:knowledge_baseZD"2/v2/{parent=projects/*/locations/*}/knowledgeBases:knowledge_baseZ>",/v2/{parent=projects/*/agent}/knowledgeBases:knowledge_baseÚAparent,knowledge_base„ +DeleteKnowledgeBase6.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.google.protobuf.Empty"œ‚Óä“Ž*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}ÚAnameŠ +UpdateKnowledgeBase6.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"‚Óä“ë25/v2/{knowledge_base.name=projects/*/knowledgeBases/*}:knowledge_baseZS2A/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}:knowledge_baseZM2;/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}:knowledge_baseÚAknowledge_base,update_maskxÊAdialogflow.googleapis.comÒAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB› +com.google.cloud.dialogflow.v2BKnowledgeBaseProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' + , 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 0000000000000000000000000000000000000000..d76f6e52a923374c230784142085c750a89251e7 GIT binary patch literal 12033 zcmd^F&2QYs6%SXICC$o`GLGc6k~kYWv1LWxO*iQW)^Sp_d(e~089*Y<7QHuGDpW|O#i z-QIN!lemR^zPg%US*_=5)#dt=AnMsIS10BCwry{lq^O&At5IwinrUx0P5V~yW~u0C zu5ajuqgj4|DMrZBc8TX`I>|4sRjv?UYiPcazv)lkRgwbBKIbW`)Z{90QV zx{dPi&uML$hMxC)4JOGyWq7J#89oRb@4$L4=9`-75s>d5+iY37Z`f9z3anZ>nLC%~ zI_cP_92?euF&|j9MqL8#*j%=J;#!)yStXwC8jf$fYcRB2-X?zNNcv>%oS2rXGn)B1 zZezLJW#q-Y@3u&E_I%zYe#^BkFuSRO{qWajg3lDk*i|`^t7&ZaKYfy-4dQv=v;LKYNMJs= zqIowCA-e$)*9Y)(4;vAkO##f=ZM)SA}^X0Z0eRkn;391GQbs( z60gpSS8T!<8)+0bs?LBThR>x8_c%Jl$bjY;jR6@Hxn;Y60Wsn+p(`BWu|SKr!J@*q zeh^JDAaIB4=tW8wEswvDe>RM=5%R+iqa&0=b5dTK8>Z$N81z4p-1hlX3Nv*mZ6fj zIUlMmkGQJQ$c?l|T4=Um>#bb~s|VUR&#O(t1Q9Pcnjf0WmTLVPS`9P>8wP-r>Zw`2 zyT@EG`x1IQbrjB`p&Mk6dkr5$!#6dv#XUAw&U{Cb*U%B_5Bvz4T3@|fQ?IUUtko8m zFD=)qQxD-ulzsW?6=g+LmTD{YDG47(lgicl>J_D4tBQviJdQ?dD^>OCMs0m+sQh>7 zOXYJ3Jsp8P4-6pQE5OEDj06L}0?2ri=)PCHEq?760joD*nVi{+x1)dVM>kh0)7~EU zv6`UEv>|A8hbZ0-eja)P`6t6@gh?kY*lpCv z%rp*T@`n)ls}7tYNP=@?k)z=sU{V%2$`~!CU!_|;b3{`1hXo;z_q#{XG|RVl$Ra1g zAS{(mG<8C<&$weaUHH@;hUK(;!D3IR0kRIGm+9b_AA(q9$xX^4T$)qJnKbDd9Uh1; zBkU5#+*70FRE{$80mQc2^1*;e@s1TV4k_yHL0DaF*UNEgeJ0J6SLt{NH55R!005dj z4u?ZX0kuQZ1T*IwX_^!!7S~rm$MmpdK4Ui`zf|vysPN!+OB5H>^ zI2!(8=(~6+VHFBQMz5Tsx(36$RSiNqDdAo zhE$FWj@J3KWp+ki{&X0f0^AU77fS4Sr~$vQSv?SXsG{+XBv;{6wlanc-R0Es`BA_FgENFE%Fj-8aEXyj+I}BvwFH2CaBmS7B20N<2(^~M9 z22JovDx~YgB+ia)?a`1izVkp$oS^9WCRvYS| z?QPnf3salXShn=7wEPJbueZfTj(1WbD+X|k66x{cp#8otO5}J=#m@nhNO74hJs?Uv z41XO!iTpgC$`D;Fn?Q+(Epq@$#Or7xhBUf|W=rKXSS->uF>p+HHm(L>T?VYm?`6=8 zuvVcpr%4Vhiu*0R6f|MNjtS*Pu-P%>Rn9?Wd`~&u&q3-W8iyQW%*sk@ic(Qp_uvW+ zzrnde{xKX6x*Q>LvVtaAK@P;AS>7$$l;K7BxirrUe=1A@&m?;TI5}a7^7|Q-6V_bP z-r_3$PXqIwgia>7LWHJ_vQ6!+SXffa`_P{QhU6;=%?dj79HvC5e~vn?5lf0EFniR%^-fJF4DKX^$Ti$pq025#Kr0H?>n zp|5EbucK^q`+@^M-<-wHn%ZTG2m+Bpu|`{>tY~B>iE;Vg8FV~pQ(Hqb4XA&0dVHh} zK3b@=GrpMh*);m7GD&)kMvo1`**DN^Vo9R#wcFd&pTd zvZk!pmzB%VKORHFmzG!HXGZ=)LdQCZ6=LBVJ~Z@Mdw{mCTdu(ZGlr+osAn0DL*Q^U z1Sgp>dIn{IZxC1#Yn^7G@E#4C?ocYzBhw!Q-NO#!Wr!caQDLnRiHdpF13@IA01PjDrOZ3h8>;fHE4bVJr-z= zY-nxeyg>hEU{zA9K`0Lc7gevJQ-S(6Tf_F%o`7#PsmK=-gkfXbU$BD8G;9Q+Q$xM- zc{CY2>vmsm@Xj9V{=SJG5$$}^5Slsx746^4<3}VCmj88mGY#pRIWKHyQMB*WChs zKF#p1;iCCFo8F#_Oe_ChdiS$0KFs`FlAos^($MQYaQwya0%bmSH#pyUA6Smwrd?l^ zzuQAe`}SoJg?ALp?OA~T0#D)pNNA$-k^`rnSvtoK?xOd(i{8Q9L-bBO#Xp_brStpO zE0{YaE|=nxxQ;styNSmi0QbhPK5!~$#zzOMPlZ*t5a%hl24Y|dJTV|vLQizdrTC%~ zZ+8@N$AC$x}lb$YJ!vk;hpDv$p5ByFlg-8!@S%?Q1h%9Uzc*Xg6P&-rS_0r`a zb$TjH@lvYtJIaYj{wzeUneg2Vn&@m0r{_}V*ua0KG?I#o2rT_8@TB}oeBlFRS6QQ% z&Ee%&S(?B8x_m87;UG@zQhrC7iF%SXS6Ej#=Hke`7ybopjwCnZaccLehfv`33u#X8 zDJ#7H(46$Fg#VmDlcFwBL`8;EV;LJ9n376CT{6Oizj6TlL6X;lc%|<=af}z+6_ZyM zzk_8^An5WBdng_N0|!jf=A+MmkHk{jMPxc3bqx>vdALed{*-(4BT26JSoi^yl(g9P zVyI7v{G%SK@6)Fp)3m+%59kgEH$^LFoZijnm2^}f@a$nrboq1c+mEF-yWBroqZU%{ zZp&L=k9T7eh5ns=`!CALo(I3bDX;DLzT=gP#ap*-3AzctDT7|h4*wYYyaVkGdU{wm zXn1?7$}c5!3O-FsA+gHTTD$67qu)laN!MTG1$^+~A$;4mZAU-91oNPbZO`LuU5Nhi zUrG9PCR4ri+sy0|`xLyudi;fI_$hedT50PjJL^1mHvB4efqy+6`PiC%Icew#A6m1K M{DbIyw2#pL0LuChNB{r; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f39f41eb8fe642395a94ef521360c7743c1ac865 GIT binary patch literal 7687 zcmds6y>lDa5f?yF0+tX(JyI4#Q}PLtBkBuK;E&jlWD6ufijF=Ql9443#y7{q18~vt z4!(Csn&PlYpC+l(q)Up_naLmEaZ)9jG^tV~jr+`KQf1%A9YFGM1er+_6(WG!-M62= z-FbyDC-&~)fSiM zo>1Rt8otq36#R{O&flm-{Eg@3djO_wFs7|aIj{p7{_6(owqPJ6BEqTLU)P@`q;3Uotb$?>V@7IkxU9+)@xf&cHQ@KYPj}6~;1_WGG?43_6RiD*nGb+ag1g+Vq zfOt7whi|?Qv%{hlnU<7AljBmchik>n^7I8I#pqgyd%Tn+#7)1`_n^h=MPFA1qX;hc z5qPR9)T2A9`Ul&R4J*RhaDn%EiKi%L_Df(QyVTRr+g{f!aX<~2dXQIaT$hq9@8p!cMZ?jVEHr(7%Sf@O7gfoDgKDlFLQF##be|lj7bre(+&Lmh>-BTLnSP6>bVhA zm3#)1Zs6lry+0-LCxxUtNs^ukwmu9c_aPr6OXqRPpB4hALxExFiVB&tP-=gas z*L|hSyigt`p#aR7q68f>1-X7>g~xJ(+b{1#By$CqtD*T_NT@cG~0v$f!zYXxRv6+trXP&NZs7k+)zR9ZG$U7aRtdFg8Pe z2vadd%rJCZbYk+T8t64DG7G1>#IuOXd~fNVd2QM!r#8wPUfoKP{&orY11qfg=d2H%IX3eTb{hv6Zj45wt{&yR^?3WwW3(8ZERZ;H;kFNir5 zlqP5hcG9-vGThB@FKfA2g^7kdhl{cBAUeW1!TVm4b}_KPSqr}(ff+;~YHVPL_x2=A z-2aDJUy^3G<3vgmV&5`7MHOb^_-W6KFh2K8Clj@G%Q; zT5am01G}vjwnT-S7sG^#dR4eZAyQ7YERTirRXEBj;7njd_&5*^2|M$kDf~k`~U9uWX_~gmy~IO7P|TaL#dcWh6fs!C17r z#2{jW6t`7;ei!{^LU`jLT#{R)-ZAW!j>8Y5d$Lx-V1hcILF4*C5x7N3_}e3l;F(EU z7JfYfmj)nb(loyUq`$w*99ISRVOVgngI%cRN^d+^krV#@4MA>9|ILOVH>F`V1hLT! zg3;q_2xJAuW58~#oH+I-qhR5eBQPBW>!1T)Ku(P-Vq+KhI9{GRUO2)rhTqE&8~}an zIr2hOggHwlAcOfWs!{-EhEw5u(z4{B$DNQf?m{QTgJLExdp+HKGaIW+4BhzPegntm|tpm+ShEpRO*~=a&|i>a~dz zIH{odlhk^3 z4Q9md_L}OwxnGYaH=$Lg@FiS`k;9uEnTM%?jAP}*O(qgqxC7bf3&EX>nXV^2l1Bez zH*oT_`~Wu(?u&H!pQDgbt1BbljzF$|4kV?dD(I(Fi{|v*;Ta@Q7XF(4>0kcwi}df( zg%A1rkR7#uKft-;CwMu|_;a_!Ftjxv2+#s3Z%>);5xN=_>UJftl=!*WWI;qUKEwe{#qvYo)I3J;2f2hbu zNim9L38VY*F*sG2Pt2z7rl!CCL-pdoYs5cSUv_-I%POVP*4CCfD!OAd0>2~Qpxx=> z)YWpmjoXKj_l}zTZUiplRb_$!b2(K9%lxI*a_WmuWG47?|X3T3xK`CDk?!qp>e*muj9UcGx literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..51d43436e46cc34ccd380add5212c419110897f2 GIT binary patch literal 5745 zcmcIo&u<$=6vlR2(WwOO5+$vxwp%x-sY!Mvw-Ul7rJL9ZQR~`D(^j!8ne}>{ELra^ zJL9Aw@+AkvjRWF>kPrn4i6bEX0)&7g+;ZZ;seeJmiP@Rmwd0+&vu>M1{A1^R@6CJf z`{sGxeb3&s!4+{Cn$S@(Y>JIt5pP1#b}VdZmLWDetrm1d&1&1a0Ub#c3uWPQ)G1<4d%rS%i1uYtQl6PDK~Z1ur^wTwIgrmWCRh?Ewc_ytmEA}-nF4b9ROge zZHR1DgW_^!p#-toRIyrHrdYK_7pqnXuxbx;Hv!NL6(R9H!z@zBHG&BCfJpxAPQ%bO z5n&aRmuVfHwbYQ=C zQFI{gIOa_nw+qk>-qkpnQ*6Dan5N}s!7@=k-`i6UBFb>l&`G7@*(~YMXfD7_bz8Tb zc&4k+YoQ|t$?1z)uMv*!J*XkcV6koE-7!q*#!D*N;@i@;nY*QXO`%DA~?)R0lZ3` z=n$PviK&@Wxw&D$491lx50Ro|_7gw|dl069SiHBkvbJ6?KP;}Ut`v&(QkndFaPNMl zxVW;kQY@T)MYs$ua98;@rxU^zaEZI*{)0;8Zm~q3olfR|Pd!zBO@X)i8iu8a^a_%Q z=*ywB2t`t-521#Uyyv~^%IXHmh_CbH0b=Uhm1&}O-OZD4*$1lsU7;Nb1I=ySvCKAE zPK|<3UAcpxL%wrgy7AmqIqnQgWBMrX`ESSC%6=jq_{-Q}=8FWla92k-R4}v(Kk7h) zg+*|}RvnU6k1^K?WBya-gjm&|1Sf4$?K&doDW%nMx1AHh6ae&lY;8f4(88l+BJ)WC zT#Skf+2nA7!W}T-HBA4AfJm4l$raiy3FLJXKF0OFXk7N6%zOaOFT-$p{Ol-))Wpk8 zEM{bWAzNK^Aeo~=VfkKONDa#14NksjHAZMrC@!W&-;=-}*ktsI4m`rAtG#3S6mEc1 z9qO{~3cVM6+80tnC^}wA!TCztETe&o1!%w_fj)m7b5AFL5Xux1eoKK#ekTj>_;GX2 zUx{zybwoNpjwvHf=I7-8-~WD|{4OcnaOdnjM(_DRjk1HnoIRw-)sk>$sNEr<%6jUX z?FsJy+=6gB0?wCLB##PdU3he4jCkQ4D4zTYKc&C~PYQ&$ht+~-;TLh}01#@W%#Qux*k^RQd5x%qi zL~iRjyuFYeA1FNL9w?VMrJe1YY=kE%FcmSg4DZMYBfldj{lhAlmFOKt?{LX7fr{B? z)l!ye5#KIuE~^V!COd<0F`A;fo@EL%8Y6Ca-rB9gi!C>Mge1zt$kX z*Eg*G%U2R4nG1W~?8eRh56=>bC&^@C>4#)`nO?a{i|&=HR0ytIrH8r33EE)SuLgHj Wv+RDd?>aN`DwD2cSB_oK1>k>5augB( literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..9baa2f455897615e8d5f736e100c23154b2224af GIT binary patch literal 1126 zcmb7DQE$>v6t;j4?$lx960!$##3k#ZmZbW`WQIW@O%w=2j0*|5lnc8_*W28Ci=`0d@(rdnX@>#HtF9+A-6p5iyOLDbr|Z9U47xt+bQ=dx3K)?JV@&NFYRjuJ01#5E9O)c0XWh z6*ah$){C~IHZyX3Nw|-_QIiOl(?BxbQ>E4FoXB*i(I4Y*)i$D|GcXd3)#?qAHIO_c zo8198ksvO%| zaXRf{MlYcIcE8{47qj|9ly4}Y)2M$a=E`TNxK@_rOilJ=k!EikYY}S1tg&sqyu*km zKQ#1A-PC^|C%f01$EoXSXUB;RR|{nql{wqII2=%QbZeJ_$LNKG8P^X@FiOx!j2Htr3nZle8|;5}|*}7;6du literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b1f9bc09a0945675df9294d88105e9ba9aede058 GIT binary patch literal 3769 zcmbtX&u<$=6lR?^Z6-~dPNURyrLuJ@>V#w$Oc1I=3Y++cETyq!Cqa!Yto3^AELra^ zyR%74WC;+W7fv9!apB0nfy4oc3*2(bffFZ=2ytL`W_E4Ij_ZV6yxDp0&HLW>zPB^) zzGv^*U{1^-6FDkIb+Ptb#Cu4z9Sd8UWr#Je(Lj!Aw!}<2zjdFu zx|Zi?C?z&6t7#xvGc2zz*LBsfnhnD`ln;{f0did3G9?-m08?!t*H$$o=89`i5LW9d zRx3H`Us?D4E9ua`vXfi^Kr>X=6?a%1a0Ep1XL~h6*F+bqnEX7@-KuWtm^kX65FD#w zLp5APeEV%1o~dDykmx%UObsRGMHbVyePCMz_o^6VRP;+h%23Ih7&)eDRMN=R9Nos2 zQzWLTR1@K_fc~4rJm1z2r#Hj|%Q2PeOLA4jj)%H;7exnQ&oNhM-hO~~_*5BCFU8g? zifLMY6)e+Dr8<~8Af+|9_&k7W$Cfb8$+qr!#>CowIo93d>$WyFJ?hvRGGjSvy`Zy zq>iAZgJkSBkD}T-5uDE<(^l-&u7!qARJF#L;s$rR3>;1eU%Jbes7gt{%g8S{Ukv0O zF0$w?Qr1&jhZZ=f9W#jkGzPA41;d-*l0OBaf+!>=*2YehF&G7tb*?MY$k9l!BEY-g zI-ej_(`(g`6CERqmzmo#nA99ZMpxC}FM5frOeSLz!@_nZSfr3h=9LBGz9v04I!+v} zC*KSl22@+(Ne91W>PX|nKLAsFmA!@cKx`*dD(4HE)$*3IwOy`mZhH3=*N-mB=)f zgHpau3jPt&uqz+&r?#v%NlOG{mn`t|wc+~%j15a;vqL@#9?y;t|4ab4Hgp&B?cEak z*dr2wkHEOCI%HeU>HLWj`A3<9BOsUs6E?}X>XN}td8gD0@HPPSJ+}6dNjayjBE%bD zrZ)xGCZi9*x4~78)FoMrkw%ysfmgE64HG@X)vnEG_r*8B%^V7l20-8GXN(pzBqY=;8fU54b4G|)0oq$~G%9V=XM@K*tVPNTx5Vfl9K0(hfn zB);E+$e-PPctSYxLOVos+OiK%x7V>kzY6d#0ZjEM1rDX4$MjsNUI-MH9UqaXRG^IA z)%XP%3*C>E>#Qjjxq9K35ir%G#^I2AOwR@Rdj|PaAt}+8;|WNoi8}QOS!jpJ?`D#z zp{_$Y4#ONPxA@+RT{8pzOt|lv2Ez-{V;U4A^z0Zk@d9J}rHFTz7Z}N> zEr$Z+O&ojni*o18ulH}t(>;uBHzmu5hlf1f@YAk(c#mDAmTW`C4a;dQzRbL{)!MfL zxJOP1K@kQVY1Xds@mTZ=R1|g}Gb4U#@{boytNRj1QX})Jvxi+<>Hg<$LHHpONoRkI y#B%f+C$0O}I4K=oQP^N1GE=tsrU1-{%4ZwfVinternalAddGeneratedFile( + ' +Ó +(google/cloud/dialogflow/v2/webhook.protogoogle.cloud.dialogflow.v2\'google/cloud/dialogflow/v2/intent.proto(google/cloud/dialogflow/v2/session.proto4google/cloud/dialogflow/v2/session_entity_type.protogoogle/protobuf/struct.proto"Ö +WebhookRequest +session (  + response_id ( = + query_result ( 2\'.google.cloud.dialogflow.v2.QueryResult_ +original_detect_intent_request ( 27.google.cloud.dialogflow.v2.OriginalDetectIntentRequest"€ +WebhookResponse +fulfillment_text ( H +fulfillment_messages ( 2*.google.cloud.dialogflow.v2.Intent.Message +source ( ( +payload ( 2.google.protobuf.Struct< +output_contexts ( 2#.google.cloud.dialogflow.v2.ContextD +followup_event_input ( 2&.google.cloud.dialogflow.v2.EventInputK +session_entity_types + ( 2-.google.cloud.dialogflow.v2.SessionEntityType"h +OriginalDetectIntentRequest +source (  +version ( ( +payload ( 2.google.protobuf.StructB• +com.google.cloud.dialogflow.v2B WebhookProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' + , 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..664ea58c7fc0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php @@ -0,0 +1,541 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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() + { + @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..39e0da50ffd4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php @@ -0,0 +1,71 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ApiVersion::class, \Google\Cloud\Dialogflow\V2\Agent_ApiVersion::class); + 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..e1e08fd21806 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php @@ -0,0 +1,66 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MatchMode::class, \Google\Cloud\Dialogflow\V2\Agent_MatchMode::class); + 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..c20b42316e00 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php @@ -0,0 +1,72 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Tier::class, \Google\Cloud\Dialogflow\V2\Agent_Tier::class); + 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..0317768299a3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php @@ -0,0 +1,243 @@ +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]: 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; + + /** + * 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]: 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. + * } + */ + 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]: 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]: 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; + } + +} + 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..f3f32765064b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php @@ -0,0 +1,64 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnswerRelevance::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_AnswerRelevance::class); + 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..51a3988cfaa8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php @@ -0,0 +1,64 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentCorrectness::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_DocumentCorrectness::class); + 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..70517d74d9bb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php @@ -0,0 +1,64 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentEfficiency::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_DocumentEfficiency::class); + 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..7191a6938718 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php @@ -0,0 +1,158 @@ +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 = ''; + + /** + * 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. + * } + */ + 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SummarizationFeedback::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_SummarizationFeedback::class); + 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..8e11dfb59301 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php @@ -0,0 +1,108 @@ +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. + * } + */ + 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; + } + + /** + * @return string + */ + public function getAnswer() + { + return $this->whichOneof("answer"); + } + +} + 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..5ff14a2f9593 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php @@ -0,0 +1,437 @@ +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); + } + + /** + * 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\EventInput $event_input + * An input event to send to Dialogflow. + * @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; + } + + /** + * 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; + } + + /** + * 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..7f1ce53b0bd5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php @@ -0,0 +1,428 @@ +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: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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..932abff578cc --- /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..60634917c402 --- /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..638d5f1b0759 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php @@ -0,0 +1,71 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CorrectnessLevel::class, \Google\Cloud\Dialogflow\V2\AnswerFeedback_CorrectnessLevel::class); + 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..d215db2c97a1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php @@ -0,0 +1,189 @@ +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..ecbdd73bdf6a --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + public function getSnippets() + { + return $this->snippets; + } + + /** + * Article snippets. + * + * Generated from protobuf field repeated string snippets = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $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..615d7a2cde86 --- /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..2deb569bf5cd --- /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..ee0084582a04 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php @@ -0,0 +1,118 @@ +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; + + 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', + ]; + + 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/AutomatedAgentConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php new file mode 100644 index 000000000000..eae81e0e0ed5 --- /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. Sets Dialogflow CX session life time. + * 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. Sets Dialogflow CX session life time. + * 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. Sets Dialogflow CX session life time. + * 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. Sets Dialogflow CX session life time. + * 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..a7eb6d7bb899 --- /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..a82ee1df28e1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php @@ -0,0 +1,70 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutomatedAgentReplyType::class, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply_AutomatedAgentReplyType::class); + 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..c78351121644 --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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..5eca1fa7c49d --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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..cd9bed492c1e --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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..268ec6c84a48 --- /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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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..3a34274aa00a --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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..6a281fc67777 --- /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..b73eca89fee6 --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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..1420d0617909 --- /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..fe289de698ad --- /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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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/ClearSuggestionFeatureConfigOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php new file mode 100644 index 000000000000..ffff95f24c72 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php @@ -0,0 +1,192 @@ +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..6c9f54d4f8af --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php @@ -0,0 +1,184 @@ +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..23fa65104d40 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php @@ -0,0 +1,706 @@ +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 observed at runtime. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + */ + protected $no_speech_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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $speech_partial_results_end_times + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $dtmf_partial_results_times + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 observed at runtime. + * @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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 observed at runtime. + * + * 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 observed at runtime. + * + * 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; + } + + /** + * 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..32ef27e208e7 --- /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/Context.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php new file mode 100644 index 000000000000..08daebb8c022 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php @@ -0,0 +1,269 @@ +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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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..618526d0cb82 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php @@ -0,0 +1,380 @@ +google.cloud.dialogflow.v2.Conversation + */ +class Conversation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + 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; + /** + * 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; + */ + protected $conversation_stage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. 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 + * 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]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * 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 conversation. + * Format: `projects//locations//conversations/`. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + * @return int + */ + public function getConversationStage() + { + return $this->conversation_stage; + } + + /** + * 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; + * @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; + } + +} + 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..f2c3504ddeb6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php @@ -0,0 +1,69 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConversationStage::class, \Google\Cloud\Dialogflow\V2\Conversation_ConversationStage::class); + 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..5f851d42bcbe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php @@ -0,0 +1,64 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LifecycleState::class, \Google\Cloud\Dialogflow\V2\Conversation_LifecycleState::class); + 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..7d2a3590cc7a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php @@ -0,0 +1,316 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + 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..4a557d0712c2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php @@ -0,0 +1,200 @@ +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. + * } + */ + 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; + } + + /** + * @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..528852c42e6f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php @@ -0,0 +1,96 @@ +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. + * + * 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; + /** + * 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::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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Dialogflow\V2\ConversationEvent_Type::class); + 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..b4466ff047bc --- /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..411295745a1d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php @@ -0,0 +1,346 @@ +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 = ''; + 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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $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. + * } + */ + 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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $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; + } + + /** + * @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..e18b5e917760 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php @@ -0,0 +1,64 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ModelType::class, \Google\Cloud\Dialogflow\V2\ConversationModel_ModelType::class); + 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..fcfa0dcd49b4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php @@ -0,0 +1,108 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Dialogflow\V2\ConversationModel_State::class); + 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..a1a91b98b37c --- /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 tooks 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 tooks 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 tooks 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 tooks 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..64e096436091 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php @@ -0,0 +1,68 @@ +google.cloud.dialogflow.v2.ConversationPhoneNumber + */ +class ConversationPhoneNumber extends \Google\Protobuf\Internal\Message +{ + /** + * 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 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. 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..de1aedc1361f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php @@ -0,0 +1,703 @@ +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; + /** + * 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 = ''; + /** + * 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\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 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; + } + + /** + * 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; + } + + /** + * 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..a68b43e00287 --- /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..2ef96b057c10 --- /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..ebccff2c3948 --- /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..1de934923f8f --- /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..f4ccf021f2f8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php @@ -0,0 +1,85 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata_State::class); + 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..f1363b6bfb18 --- /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..3ec1f691d67a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php @@ -0,0 +1,155 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + 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..798f8671039b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php @@ -0,0 +1,94 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata_State::class); + 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..bca3576d24f3 --- /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..e6963cffd5f6 --- /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..b27bde2a13f2 --- /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 fomula + * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * If the field is provided, the caller is resposible 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 fomula + * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * If the field is provided, the caller is resposible 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 fomula + * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * If the field is provided, the caller is resposible 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 fomula + * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * If the field is provided, the caller is resposible 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..d642fc5392e8 --- /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..54bd1e823b46 --- /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..44e1ccca9286 --- /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/CreateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php new file mode 100644 index 000000000000..cb1644174e89 --- /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..f46bccbd096b --- /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..20b8f7fc2b7f --- /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..136ace21a71c --- /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/CreateVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php new file mode 100644 index 000000000000..d7797b86258d --- /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/DeleteAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php new file mode 100644 index 000000000000..a1e2bb7beea3 --- /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..49e06cedaf16 --- /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..46b951b0a581 --- /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..5fb0b3ce7894 --- /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..27435f1e5011 --- /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..30cc0069d1d4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php @@ -0,0 +1,121 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + 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..03defafd52dc --- /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..232c89d32c16 --- /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..1ae4fa249bdf --- /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..710ea199af0f --- /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..4ff70b6dccd5 --- /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/DeleteIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php new file mode 100644 index 000000000000..6d9bcb459a3a --- /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..7c1a9a71d578 --- /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..e5a1c482bf1a --- /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/DeleteVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php new file mode 100644 index 000000000000..2d813ed0f32f --- /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..fd4a874258f5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php @@ -0,0 +1,121 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + 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..13c3d0a67d6d --- /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..5d1b90f9edf2 --- /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..8c07c511577f --- /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/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php new file mode 100644 index 000000000000..74886da23f21 --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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..4e8437ac0670 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php @@ -0,0 +1,85 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KnowledgeType::class, \Google\Cloud\Dialogflow\V2\Document_KnowledgeType::class); + 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..d54cc82076fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php @@ -0,0 +1,132 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReloadStatus::class, \Google\Cloud\Dialogflow\V2\Document_ReloadStatus::class); + 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..ec19452cb6b1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php @@ -0,0 +1,85 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Dialogflow\V2\Document_State::class); + 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..be68501e748b --- /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/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php new file mode 100644 index 000000000000..2c3f5a2d924b --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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..77ac68085257 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php @@ -0,0 +1,60 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoExpansionMode::class, \Google\Cloud\Dialogflow\V2\EntityType_AutoExpansionMode::class); + 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..80fe15446286 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php @@ -0,0 +1,148 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entity::class, \Google\Cloud\Dialogflow\V2\EntityType_Entity::class); + 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..51d8c6f0d4e1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php @@ -0,0 +1,75 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Kind::class, \Google\Cloud\Dialogflow\V2\EntityType_Kind::class); + 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..290c6bec564e --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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..89d14a767203 --- /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..6e41c7c1bc9b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php @@ -0,0 +1,75 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Dialogflow\V2\Environment_State::class); + 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..103f60872d39 --- /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 array<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry>|\Google\Protobuf\Internal\RepeatedField $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..4f71c3339858 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php @@ -0,0 +1,148 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entry::class, \Google\Cloud\Dialogflow\V2\EnvironmentHistory_Entry::class); + 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..316467a477c0 --- /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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $datasets + * Required. Datasets used for evaluation. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig $smart_reply_config + * Configuration for smart reply model evalution. + * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig $smart_compose_config + * Configuration for smart compose model evalution. + * } + */ + 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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $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 evalution. + * + * 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 evalution. + * + * 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 evalution. + * + * 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 evalution. + * + * 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..1dc54f0c1349 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php @@ -0,0 +1,124 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SmartComposeConfig::class, \Google\Cloud\Dialogflow\V2\EvaluationConfig_SmartComposeConfig::class); + 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..81d493a47cd9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php @@ -0,0 +1,124 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SmartReplyConfig::class, \Google\Cloud\Dialogflow\V2\EvaluationConfig_SmartReplyConfig::class); + 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..fc4d095fa41d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php @@ -0,0 +1,229 @@ +` 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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..638f4e4b04ac --- /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..0568ef0c383c --- /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..84bd5410682c --- /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..146257008327 --- /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..c8d2453ee36a --- /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/Fulfillment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php new file mode 100644 index 000000000000..5284053b6d8f --- /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 array<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature>|\Google\Protobuf\Internal\RepeatedField $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..727ce7d8bfde --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php @@ -0,0 +1,70 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Feature::class, \Google\Cloud\Dialogflow\V2\Fulfillment_Feature::class); + 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..b516d100f4e8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php @@ -0,0 +1,57 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Dialogflow\V2\Fulfillment_Feature_Type::class); + 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..3310056f4a7c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php @@ -0,0 +1,236 @@ +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() + { + @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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GenericWebService::class, \Google\Cloud\Dialogflow\V2\Fulfillment_GenericWebService::class); + 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..d98f64a1385a --- /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..fd50c5a6fcdd --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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/GenerateStatelessSummaryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php new file mode 100644 index 000000000000..a09c5be3763b --- /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; + /** + * 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.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 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4; + */ + 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 + * 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 + * 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; + } + + /** + * 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.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * 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.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 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4; + * @return int + */ + public function getMaxContextSize() + { + return $this->max_context_size; + } + + /** + * 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; + * @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..076245af5307 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php @@ -0,0 +1,125 @@ +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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MinimalConversation::class, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest_MinimalConversation::class); + 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..81b03751852e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php @@ -0,0 +1,166 @@ +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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [GenerateStatelessSummaryRequest.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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [GenerateStatelessSummaryRequest.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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [GenerateStatelessSummaryRequest.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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [GenerateStatelessSummaryRequest.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..3fb0ebee15de --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php @@ -0,0 +1,112 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Summary::class, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse_Summary::class); + 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..44a4bc873d9f --- /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..a41566ffa78c --- /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..73859a70d1fb --- /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..0f8ebc8d15eb --- /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..675d2da7dc2a --- /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..4670cd395f3a --- /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..7046ac428ddd --- /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..283f734009eb --- /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/GetEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php new file mode 100644 index 000000000000..18edb8c6851c --- /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..8df0e1890a1f --- /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..286b2cd6e7ca --- /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..fa37a6081b66 --- /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/GetIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php new file mode 100644 index 000000000000..6767222f02d1 --- /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..94d7edad9427 --- /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..b9ab9c6df7ed --- /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..bcf3bf0e96ed --- /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/GetValidationResultRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php new file mode 100644 index 000000000000..67ee2984cfff --- /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..19dad18afb6f --- /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..3a0c7664abc3 --- /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..2a77bae7a69a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php @@ -0,0 +1,138 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConversationModelConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_ConversationModelConfig::class); + 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..5aaf665a8da9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php @@ -0,0 +1,74 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConversationProcessConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_ConversationProcessConfig::class); + 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..961e99d29168 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php @@ -0,0 +1,196 @@ +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; + + /** + * 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]. + * } + */ + 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MessageAnalysisConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_MessageAnalysisConfig::class); + 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..5a572f34db48 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php @@ -0,0 +1,140 @@ +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; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig>|\Google\Protobuf\Internal\RepeatedField $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. + * } + */ + 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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuggestionConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionConfig::class); + 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..c1050336bb55 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php @@ -0,0 +1,302 @@ +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. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + */ + protected $enable_event_based_suggestion = 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. + * @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. + * + * 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. + * + * 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; + } + + /** + * 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuggestionFeatureConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionFeatureConfig::class); + 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..eddcc48c7c3f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php @@ -0,0 +1,326 @@ +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; + 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. + * } + */ + 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; + } + + /** + * @return string + */ + public function getQuerySource() + { + return $this->whichOneof("query_source"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuggestionQueryConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig::class); + 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..dba5d8e3a3cb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php @@ -0,0 +1,143 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContextFilterSettings::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_ContextFilterSettings::class); + 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..1cfc95c118b9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php @@ -0,0 +1,83 @@ +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 = ''; + + /** + * 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. + * } + */ + 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DialogflowQuerySource::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_DialogflowQuerySource::class); + 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..fc256b2de3e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php @@ -0,0 +1,83 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentQuerySource::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_DocumentQuerySource::class); + 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..c525c1941b75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php @@ -0,0 +1,83 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKnowledgeBases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->knowledge_bases = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KnowledgeBaseQuerySource::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_KnowledgeBaseQuerySource::class); + 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..c53a6921ed42 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php @@ -0,0 +1,108 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuggestionTriggerSettings::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionTriggerSettings::class); + 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..61331a7dc1e6 --- /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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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..63924ddc8d81 --- /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..6e6f2dac5c30 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php @@ -0,0 +1,74 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LivePersonConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig_LivePersonConfig::class); + 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..8bc5641bf77b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php @@ -0,0 +1,184 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SalesforceLiveAgentConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig_SalesforceLiveAgentConfig::class); + 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..6c0b27e42f2d --- /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..fd0fdeede7ef --- /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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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..9e946c081918 --- /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..4dbfc9178c1c --- /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..674d0140d28e --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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..a0ead26c3808 --- /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..98f7b7ae4fa6 --- /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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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/InputAudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php new file mode 100644 index 000000000000..96d1adff0ab5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php @@ -0,0 +1,624 @@ +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; + */ + 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; + */ + 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. + * + * Generated from protobuf field string language_code = 3; + */ + 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; + /** + * Which Speech model to select for the given request. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then we auto-select a model based on the parameters + * in the InputAudioConfig. + * 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 (best for very short utterances and commands) + * + * 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; + + /** + * 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. + * @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 array|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $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 + * Which Speech model to select for the given request. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then we auto-select a model based on the parameters + * in the InputAudioConfig. + * 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 (best for very short utterances and commands) + * @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. + * } + */ + 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; + * @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; + * @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; + * @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; + * @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. + * + * Generated from protobuf field string language_code = 3; + * @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. + * + * Generated from protobuf field string language_code = 3; + * @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 \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getPhraseHints() + { + @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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setPhraseHints($var) + { + @trigger_error('phrase_hints is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $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; + } + + /** + * Which Speech model to select for the given request. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then we auto-select a model based on the parameters + * in the InputAudioConfig. + * 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 (best for very short utterances and commands) + * + * Generated from protobuf field string model = 7; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Which Speech model to select for the given request. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then we auto-select a model based on the parameters + * in the InputAudioConfig. + * 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 (best for very short utterances and commands) + * + * 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; + } + +} + 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..eb1a43005e84 --- /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..28917cda63a8 --- /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..13adbca24087 --- /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..2fdd45834dc7 --- /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 array|\Google\Protobuf\Internal\RepeatedField $input_context_names + * Optional. The list of context names required for this intent to be + * triggered. + * Format: `projects//agent/sessions/-/contexts/`. + * @type array|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Intent\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * Optional. The collection of parameters associated with the intent. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $messages + * Optional. The collection of rich messages corresponding to the + * `Response` field in the Dialogflow console. + * @type array|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Parameter>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo>|\Google\Protobuf\Internal\RepeatedField $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..b7cf0d145f19 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php @@ -0,0 +1,112 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FollowupIntentInfo::class, \Google\Cloud\Dialogflow\V2\Intent_FollowupIntentInfo::class); + 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..3c509bed6783 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php @@ -0,0 +1,545 @@ +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"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Message::class, \Google\Cloud\Dialogflow\V2\Intent_Message::class); + 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..8b505949bd21 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php @@ -0,0 +1,216 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BasicCard::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BasicCard::class); + 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..373c09363fe4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php @@ -0,0 +1,114 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Button::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BasicCard_Button::class); + 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..e993a7466cb9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php @@ -0,0 +1,70 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OpenUriAction::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BasicCard_Button_OpenUriAction::class); + 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..9d3fbc34d12c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php @@ -0,0 +1,113 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BrowseCarouselCard::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard::class); + 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..7fba0b85fae1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php @@ -0,0 +1,234 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BrowseCarouselCardItem::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_BrowseCarouselCardItem::class); + 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..71febe611d3b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php @@ -0,0 +1,108 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OpenUrlAction::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_BrowseCarouselCardItem_OpenUrlAction::class); + 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..cd19ba04e43f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php @@ -0,0 +1,65 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UrlTypeHint::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_BrowseCarouselCardItem_OpenUrlAction_UrlTypeHint::class); + 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..3edd8f5a6dae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php @@ -0,0 +1,89 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ImageDisplayOptions::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_ImageDisplayOptions::class); + 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..398ec1eb5c22 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php @@ -0,0 +1,172 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Card::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Card::class); + 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..615e2785bb4d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php @@ -0,0 +1,108 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Button::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Card_Button::class); + 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..3f46c5e840ab --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php @@ -0,0 +1,70 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CarouselSelect::class, \Google\Cloud\Dialogflow\V2\Intent_Message_CarouselSelect::class); + 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..a221fe59073c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php @@ -0,0 +1,192 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Item::class, \Google\Cloud\Dialogflow\V2\Intent_Message_CarouselSelect_Item::class); + 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..dd3d274a8f2f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php @@ -0,0 +1,105 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ColumnProperties::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ColumnProperties::class); + 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..96cec8e9be4d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php @@ -0,0 +1,71 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HorizontalAlignment::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ColumnProperties_HorizontalAlignment::class); + 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..1673b84f25f5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php @@ -0,0 +1,108 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Image::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Image::class); + 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..6f6730cea584 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php @@ -0,0 +1,109 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LinkOutSuggestion::class, \Google\Cloud\Dialogflow\V2\Intent_Message_LinkOutSuggestion::class); + 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..bbfef362bc0e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php @@ -0,0 +1,138 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ListSelect::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ListSelect::class); + 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..fcc7d6847ad5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php @@ -0,0 +1,192 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Item::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ListSelect_Item::class); + 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..d5430281c7de --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php @@ -0,0 +1,104 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MediaContent::class, \Google\Cloud\Dialogflow\V2\Intent_Message_MediaContent::class); + 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..59de16e065f6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php @@ -0,0 +1,213 @@ +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"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResponseMediaObject::class, \Google\Cloud\Dialogflow\V2\Intent_Message_MediaContent_ResponseMediaObject::class); + 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..7ff8438d6ca1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php @@ -0,0 +1,57 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResponseMediaType::class, \Google\Cloud\Dialogflow\V2\Intent_Message_MediaContent_ResponseMediaType::class); + 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..5da4a44f1522 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php @@ -0,0 +1,116 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Platform::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Platform::class); + 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..a3d54844bfad --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php @@ -0,0 +1,104 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuickReplies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->quick_replies = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuickReplies::class, \Google\Cloud\Dialogflow\V2\Intent_Message_QuickReplies::class); + 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..615e0f22fe57 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php @@ -0,0 +1,113 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SelectItemInfo::class, \Google\Cloud\Dialogflow\V2\Intent_Message_SelectItemInfo::class); + 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..e59d4ce2bbe5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php @@ -0,0 +1,150 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SimpleResponse::class, \Google\Cloud\Dialogflow\V2\Intent_Message_SimpleResponse::class); + 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..a8d1e0095b9f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php @@ -0,0 +1,73 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SimpleResponses::class, \Google\Cloud\Dialogflow\V2\Intent_Message_SimpleResponses::class); + 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..f5e643dcb598 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php @@ -0,0 +1,71 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Suggestion::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Suggestion::class); + 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..49ac588ee861 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php @@ -0,0 +1,70 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Suggestions::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Suggestions::class); + 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..daffa040dbc6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php @@ -0,0 +1,250 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties>|\Google\Protobuf\Internal\RepeatedField $column_properties + * Optional. Display properties for the columns in this table. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow>|\Google\Protobuf\Internal\RepeatedField $rows + * Optional. Rows in this table of data. + * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableCard::class, \Google\Cloud\Dialogflow\V2\Intent_Message_TableCard::class); + 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..80fa26fc55a0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php @@ -0,0 +1,71 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableCardCell::class, \Google\Cloud\Dialogflow\V2\Intent_Message_TableCardCell::class); + 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..faffa5e21573 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php @@ -0,0 +1,104 @@ +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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableCardRow::class, \Google\Cloud\Dialogflow\V2\Intent_Message_TableCardRow::class); + 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..238bb805c106 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php @@ -0,0 +1,70 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setText($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->text = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Text::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Text::class); + 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..dd13566fb368 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php @@ -0,0 +1,360 @@ +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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Parameter::class, \Google\Cloud\Dialogflow\V2\Intent_Parameter::class); + 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..bb0045425c23 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php @@ -0,0 +1,240 @@ +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; + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part>|\Google\Protobuf\Internal\RepeatedField $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; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique identifier of this training phrase. + * + * 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 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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TrainingPhrase::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase::class); + 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..4f319d65101f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php @@ -0,0 +1,196 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Part::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase_Part::class); + 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..a0a5ef200c1e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php @@ -0,0 +1,70 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase_Type::class); + 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..7282b5d28d99 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php @@ -0,0 +1,65 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WebhookState::class, \Google\Cloud\Dialogflow\V2\Intent_WebhookState::class); + 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..87fcc6a533c2 --- /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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + public function getIntents() + { + return $this->intents; + } + + /** + * A collection of intents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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/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/KnowledgeBase.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php new file mode 100644 index 000000000000..d3753cd6ed8c --- /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..609ea56307cb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php @@ -0,0 +1,143 @@ +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 = ''; + 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. + * } + */ + 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; + } + + /** + * @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..ea9235bbaf4f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php @@ -0,0 +1,71 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata_State::class); + 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..e0f875e09140 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php @@ -0,0 +1,231 @@ +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. + * Marked deprecated as it hasn't been, and isn't currently, supported. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + 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. + * Marked deprecated as it hasn't been, and isn't currently, supported. + * 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. + * Marked deprecated as it hasn't been, and isn't currently, supported. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getFilter() + { + @trigger_error('filter is deprecated.', E_USER_DEPRECATED); + return $this->filter; + } + + /** + * Optional. Filters to restrict results to specific answer records. + * Marked deprecated as it hasn't been, and isn't currently, supported. + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setFilter($var) + { + @trigger_error('filter is deprecated.', E_USER_DEPRECATED); + 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..f15328a1c8e0 --- /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 array<\Google\Cloud\Dialogflow\V2\AnswerRecord>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\AnswerRecord>|\Google\Protobuf\Internal\RepeatedField $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..3b9d788cdac3 --- /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..4441573223fb --- /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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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..7647f1d40cdb --- /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..5e091819a336 --- /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 array<\Google\Cloud\Dialogflow\V2\ConversationDataset>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\ConversationDataset>|\Google\Protobuf\Internal\RepeatedField $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..759979e24616 --- /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..f9742668b66b --- /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 array<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $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..286fcf7c12df --- /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..1aa84fbac746 --- /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 array<\Google\Cloud\Dialogflow\V2\ConversationModel>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\ConversationModel>|\Google\Protobuf\Internal\RepeatedField $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..71d9fdd37529 --- /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..b0a8719d5b62 --- /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 array<\Google\Cloud\Dialogflow\V2\ConversationProfile>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\ConversationProfile>|\Google\Protobuf\Internal\RepeatedField $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..7b32a8e83c0f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php @@ -0,0 +1,249 @@ +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 = ''; + /** + * A filter expression that filters conversations listed in the response. In + * general, the expression must specify the field name, a comparison operator, + * and the value to use for filtering: + *
    + *
  • The value must be a string, a number, or a boolean.
  • + *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • + *
  • To filter on multiple expressions, separate the + * expressions with `AND` or `OR` (omitting both implies `AND`).
  • + *
  • For clarity, expressions can be enclosed in parentheses.
  • + *
+ * 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; + */ + 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 + * A filter expression that filters conversations listed in the response. In + * general, the expression must specify the field name, a comparison operator, + * and the value to use for filtering: + *
    + *
  • The value must be a string, a number, or a boolean.
  • + *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • + *
  • To filter on multiple expressions, separate the + * expressions with `AND` or `OR` (omitting both implies `AND`).
  • + *
  • For clarity, expressions can be enclosed in parentheses.
  • + *
+ * 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; + } + + /** + * A filter expression that filters conversations listed in the response. In + * general, the expression must specify the field name, a comparison operator, + * and the value to use for filtering: + *
    + *
  • The value must be a string, a number, or a boolean.
  • + *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • + *
  • To filter on multiple expressions, separate the + * expressions with `AND` or `OR` (omitting both implies `AND`).
  • + *
  • For clarity, expressions can be enclosed in parentheses.
  • + *
+ * 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; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter expression that filters conversations listed in the response. In + * general, the expression must specify the field name, a comparison operator, + * and the value to use for filtering: + *
    + *
  • The value must be a string, a number, or a boolean.
  • + *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • + *
  • To filter on multiple expressions, separate the + * expressions with `AND` or `OR` (omitting both implies `AND`).
  • + *
  • For clarity, expressions can be enclosed in parentheses.
  • + *
+ * 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; + * @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..f4a0679ed9e2 --- /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 array<\Google\Cloud\Dialogflow\V2\Conversation>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Conversation>|\Google\Protobuf\Internal\RepeatedField $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..ca75b931de79 --- /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..101cf40d5b81 --- /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 array<\Google\Cloud\Dialogflow\V2\Document>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Document>|\Google\Protobuf\Internal\RepeatedField $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..a24d189e03ca --- /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..766d0263fd6d --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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..9cb3ad81189c --- /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..c5fe88b95df4 --- /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 array<\Google\Cloud\Dialogflow\V2\Environment>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Environment>|\Google\Protobuf\Internal\RepeatedField $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/ListIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php new file mode 100644 index 000000000000..67abb03cce5d --- /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..8d1fe4c0ff55 --- /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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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..5fba54aff400 --- /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..89838ab5d1fa --- /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 array<\Google\Cloud\Dialogflow\V2\KnowledgeBase>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\KnowledgeBase>|\Google\Protobuf\Internal\RepeatedField $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..bb73b25f182f --- /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..694488dc89b7 --- /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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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..ac01cf2d0931 --- /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..800b88ac62f5 --- /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 array<\Google\Cloud\Dialogflow\V2\Participant>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Participant>|\Google\Protobuf\Internal\RepeatedField $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..e178b686b17e --- /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..87ea45ce09d7 --- /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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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/ListVersionsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php new file mode 100644 index 000000000000..be9c3192b649 --- /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..653aa7dedfdc --- /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 array<\Google\Cloud\Dialogflow\V2\Version>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Version>|\Google\Protobuf\Internal\RepeatedField $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..31121f0f3ed8 --- /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..a176cd042024 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php @@ -0,0 +1,395 @@ +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. + * + * 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. + * @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. + * + * 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. + * + * 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..d1860e5293c1 --- /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 array<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart>|\Google\Protobuf\Internal\RepeatedField $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/NotificationConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php new file mode 100644 index 000000000000..f096ff33fdbb --- /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..fac3e1d43f9f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php @@ -0,0 +1,64 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MessageFormat::class, \Google\Cloud\Dialogflow\V2\NotificationConfig_MessageFormat::class); + 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..3522f20bf36d --- /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..33828b7f28cb --- /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..0380436645b2 --- /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..b8821bce4def --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php @@ -0,0 +1,86 @@ +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 32kbps. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MP3 = 2; + */ + 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; + + 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', + ]; + + 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..a569536d5160 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php @@ -0,0 +1,387 @@ +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. + * 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; + + /** + * 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. + * 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" + * } + * ``` + * } + */ + 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. + * 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. + * 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; + } + +} + 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..f2fe378e35fe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php @@ -0,0 +1,72 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Role::class, \Google\Cloud\Dialogflow\V2\Participant_Role::class); + 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..dcb659ad299e --- /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..f6469b8c6266 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php @@ -0,0 +1,415 @@ +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; + + /** + * 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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. + * } + */ + 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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + 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..f78289af3d1b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php @@ -0,0 +1,855 @@ +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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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: map + * - Else: depending on parameter value type, could be one of string, + * number, boolean, null, list or map + * - MapValue value: + * - If parameter's entity type is a composite entity: + * map from composite entity property names to property values + * - Else: 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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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/ReloadDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php new file mode 100644 index 000000000000..ea0bbfeabba2 --- /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..19fa9863b9cd --- /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..07a85234cbb0 --- /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..65b54935d344 --- /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 array<\Google\Cloud\Dialogflow\V2\Agent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Agent>|\Google\Protobuf\Internal\RepeatedField $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/Sentiment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php new file mode 100644 index 000000000000..2fb6df49acb2 --- /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..996d88c8c1f7 --- /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..a6e582c0eafb --- /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/SessionEntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php new file mode 100644 index 000000000000..2e6fedf0262d --- /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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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..7d3d5edc239d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php @@ -0,0 +1,73 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EntityOverrideMode::class, \Google\Cloud\Dialogflow\V2\SessionEntityType_EntityOverrideMode::class); + 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..89ce4e6b5087 --- /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..72ad8f5015e9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php @@ -0,0 +1,192 @@ +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..1dd6d9099643 --- /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/SmartReplyAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php new file mode 100644 index 000000000000..3a2493d155e0 --- /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..b191f64c4706 --- /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 array<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics>|\Google\Protobuf\Internal\RepeatedField $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..eb1c7e7530cf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php @@ -0,0 +1,124 @@ +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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TopNMetrics::class, \Google\Cloud\Dialogflow\V2\SmartReplyMetrics_TopNMetrics::class); + 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..5de43743665a --- /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..07a14528011f --- /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; + */ + 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; + */ + protected $boost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $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; + * @return \Google\Protobuf\Internal\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; + * @param array|\Google\Protobuf\Internal\RepeatedField $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; + * @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; + * @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..ea10fcdb7041 --- /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][InputAudioConfig.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..0015c8fb766a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php @@ -0,0 +1,158 @@ +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 a default + * model is used. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * + * Generated from protobuf field string model = 2; + */ + protected $model = ''; + + /** + * 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 a default + * model is used. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * } + */ + 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 a default + * model is used. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * + * 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 a default + * model is used. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * + * 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; + } + +} + 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..6070b604df91 --- /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..c68a5c69e606 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php @@ -0,0 +1,603 @@ +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; + /** + * Enable partial virtual agent responses. If this flag is not enabled, + * response stream still contains only one final response even if some + * `Fulfillment`s in Dialogflow virtual agent have been configured to return + * partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12; + */ + protected $enable_partial_automated_agent_reply = 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. + * @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_partial_automated_agent_reply + * Enable partial virtual agent responses. If this flag is not enabled, + * response stream still contains only one final response even if some + * `Fulfillment`s in Dialogflow virtual agent have been configured to return + * partial responses. + * @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. + * + * 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. + * + * 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; + } + + /** + * Enable partial virtual agent responses. If this flag is not enabled, + * response stream still contains only one final response even if some + * `Fulfillment`s in Dialogflow virtual agent have been configured to return + * partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12; + * @return bool + */ + public function getEnablePartialAutomatedAgentReply() + { + return $this->enable_partial_automated_agent_reply; + } + + /** + * Enable partial virtual agent responses. If this flag is not enabled, + * response stream still contains only one final response even if some + * `Fulfillment`s in Dialogflow virtual agent have been configured to return + * partial responses. + * + * Generated from protobuf field bool enable_partial_automated_agent_reply = 12; + * @param bool $var + * @return $this + */ + public function setEnablePartialAutomatedAgentReply($var) + { + GPBUtil::checkBool($var); + $this->enable_partial_automated_agent_reply = $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..f42c757ab81a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php @@ -0,0 +1,500 @@ += 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; + /** + * Only set if a Dialogflow automated agent has responded. + * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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; + + /** + * 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 + * Only set if a Dialogflow automated agent has responded. + * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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. + * } + */ + 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; + } + + /** + * Only set if a Dialogflow automated agent has responded. + * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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); + } + + /** + * Only set if a Dialogflow automated agent has responded. + * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] + * and [AutomatedAgentReply.detect_intent_response.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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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; + } + +} + 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..2644d3ed9582 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php @@ -0,0 +1,522 @@ +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() + { + @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..c20491319563 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php @@ -0,0 +1,371 @@ +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` 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` 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` 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` 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..705e93ee6d6d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php @@ -0,0 +1,363 @@ +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 array<\Google\Cloud\Dialogflow\V2\SpeechWordInfo>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SpeechWordInfo>|\Google\Protobuf\Internal\RepeatedField $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..f67361b923ee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php @@ -0,0 +1,71 @@ +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; + /** + * 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MessageType::class, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult_MessageType::class); + 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..aa503b51f5d2 --- /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..3d9372203970 --- /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 array<\Google\Cloud\Dialogflow\V2\ArticleAnswer>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\ArticleAnswer>|\Google\Protobuf\Internal\RepeatedField $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..0a4865b71466 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php @@ -0,0 +1,228 @@ +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 = ''; + /** + * 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.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 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4; + */ + protected $context_size = 0; + /** + * 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; + */ + 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 + * 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 + * 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 + * 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; + } + + /** + * 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.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * 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.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 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4; + * @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 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * 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; + * @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. Only used for POC/demo purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5; + * @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..168c11a1ae16 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php @@ -0,0 +1,170 @@ +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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [SuggestSummaryRequest.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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [SuggestSummaryRequest.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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [SuggestSummaryRequest.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 + * [last_conversation_message][] used to compile the suggestion. It may be + * smaller than the [SuggestSummaryRequest.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..8d14399a6a6a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php @@ -0,0 +1,150 @@ +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; + /** + * The name of the answer record. Format: + * "projects//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 $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 $answer_record + * The name of the answer record. Format: + * "projects//answerRecords/" + * } + */ + 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; + } + + /** + * 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Summary::class, \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse_Summary::class); + 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..78582705f831 --- /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..2dc230acbb62 --- /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 array<\Google\Cloud\Dialogflow\V2\FaqAnswer>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\FaqAnswer>|\Google\Protobuf\Internal\RepeatedField $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/SuggestSmartRepliesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php new file mode 100644 index 000000000000..3849f06f4560 --- /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..0938283c9e61 --- /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 array<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer>|\Google\Protobuf\Internal\RepeatedField $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/SuggestionFeature.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php new file mode 100644 index 000000000000..f04dab6d457f --- /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..fcc8a5082701 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php @@ -0,0 +1,71 @@ +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; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', + self::FAQ => 'FAQ', + self::SMART_REPLY => '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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Dialogflow\V2\SuggestionFeature_Type::class); + 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..1adc8b87646b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php @@ -0,0 +1,180 @@ +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\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. + * } + */ + 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; + } + + /** + * 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; + } + + /** + * @return string + */ + public function getSuggestionResponse() + { + return $this->whichOneof("suggestion_response"); + } + +} + 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..d9426069bf0f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php @@ -0,0 +1,269 @@ +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; + */ + 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; + */ + 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; + */ + 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; + */ + private $effects_profile_id; + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4; + */ + protected $voice = null; + + /** + * 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 array|\Google\Protobuf\Internal\RepeatedField $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. + * } + */ + 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; + * @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; + * @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; + * @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; + * @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; + * @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; + * @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; + * @return \Google\Protobuf\Internal\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; + * @param array|\Google\Protobuf\Internal\RepeatedField $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; + * @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; + * @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; + } + +} + 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..ad3a6c6a3f14 --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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..c9836cc74f9c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php @@ -0,0 +1,119 @@ +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..ab020b9a6dfa --- /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/TrainAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php new file mode 100644 index 000000000000..0f5f6c52b0ba --- /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/UndeployConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php new file mode 100644 index 000000000000..95fe6f8dccd8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php @@ -0,0 +1,121 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + 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..fcc391de050b --- /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..a70cc658fdb4 --- /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..e8e4bb8d3a27 --- /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..3d1cf1959ca4 --- /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..a7ed1d635a42 --- /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..0af3206ffb0c --- /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..de77205bc8d5 --- /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..3688f9f4baf7 --- /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/UpdateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php new file mode 100644 index 000000000000..0d2f04dd54a0 --- /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..827f8ac4c2d2 --- /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..75d3294f105a --- /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..27308cf6c376 --- /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/UpdateVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php new file mode 100644 index 000000000000..a5327be9b4bd --- /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..a9216f15ccb6 --- /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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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..893aa5c46a19 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php @@ -0,0 +1,78 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Severity::class, \Google\Cloud\Dialogflow\V2\ValidationError_Severity::class); + 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..2ccd637af70a --- /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 array<\Google\Cloud\Dialogflow\V2\ValidationError>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\ValidationError>|\Google\Protobuf\Internal\RepeatedField $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..8e7a86fa5836 --- /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..cafb8c2f098b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php @@ -0,0 +1,71 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VersionStatus::class, \Google\Cloud\Dialogflow\V2\Version_VersionStatus::class); + 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..762f054c7ec1 --- /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; + */ + 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; + */ + 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; + * @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; + * @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; + * @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; + * @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..e00b19da7256 --- /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..df629dd7b5f3 --- /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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField + */ + 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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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..6a566c87c5b5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php @@ -0,0 +1,65 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function delete_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + $agentsClient->deleteAgent($formattedParent); + 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..aa0b05ec1335 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php @@ -0,0 +1,99 @@ +`. 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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->exportAgent($formattedParent, $agentUri); + $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..50c7f1b26a0d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php @@ -0,0 +1,67 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function get_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + /** @var Agent $response */ + $response = $agentsClient->getAgent($formattedParent); + 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..31f5636f0173 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..0aeae9968fb0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php @@ -0,0 +1,68 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function get_validation_result_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + /** @var ValidationResult $response */ + $response = $agentsClient->getValidationResult($formattedParent); + 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..c810d6d346c1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php @@ -0,0 +1,102 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function import_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->importAgent($formattedParent); + $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..c1a90db03466 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..2576c7a2ccc6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php @@ -0,0 +1,100 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function restore_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->restoreAgent($formattedParent); + $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..69eeaff5244e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php @@ -0,0 +1,78 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function search_agents_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $agentsClient->searchAgents($formattedParent); + + /** @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..a4149c56d3d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php @@ -0,0 +1,99 @@ +`. 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 any non-scalar elements to be passed along with the request. + $agent = (new Agent()) + ->setParent($formattedAgentParent) + ->setDisplayName($agentDisplayName) + ->setDefaultLanguageCode($agentDefaultLanguageCode) + ->setTimeZone($agentTimeZone); + + // Call the API and handle any network failures. + try { + /** @var Agent $response */ + $response = $agentsClient->setAgent($agent); + 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..52e6ece194ac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php @@ -0,0 +1,89 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function train_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->trainAgent($formattedParent); + $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..4c45237cb172 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..383b871f120b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php @@ -0,0 +1,74 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $answerRecordsClient->listAnswerRecords($formattedParent); + + /** @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..67f38d2cc8fc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..dbb982702e80 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php @@ -0,0 +1,61 @@ +setAnswerFeedback($answerRecordAnswerFeedback); + $updateMask = new FieldMask(); + + // Call the API and handle any network failures. + try { + /** @var AnswerRecord $response */ + $response = $answerRecordsClient->updateAnswerRecord($answerRecord, $updateMask); + 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..f34d47416957 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php @@ -0,0 +1,95 @@ +/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 any non-scalar elements to be passed along with the request. + $context = (new Context()) + ->setName($contextName); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->createContext($formattedParent, $context); + 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..9943ce9523ac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php @@ -0,0 +1,69 @@ +/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(); + + // Call the API and handle any network failures. + try { + $contextsClient->deleteAllContexts($formattedParent); + 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..9139cff88fab --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php @@ -0,0 +1,69 @@ +/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(); + + // Call the API and handle any network failures. + try { + $contextsClient->deleteContext($formattedName); + 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..327dd437a96f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php @@ -0,0 +1,71 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->getContext($formattedName); + 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..1e34a3e5b84b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..156c35a9edf3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php @@ -0,0 +1,76 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contextsClient->listContexts($formattedParent); + + /** @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..b0269323ae6f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..02496e0818b3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php @@ -0,0 +1,85 @@ +/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 any non-scalar elements to be passed along with the request. + $context = (new Context()) + ->setName($contextName); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->updateContext($context); + 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..bd0bf6bf824c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php @@ -0,0 +1,95 @@ +/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 any non-scalar elements to be passed along with the request. + $conversationDataset = (new ConversationDataset()) + ->setDisplayName($conversationDatasetDisplayName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); + $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..a7ca14130f04 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php @@ -0,0 +1,90 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->deleteConversationDataset($formattedName); + $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..23594786b5bc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php @@ -0,0 +1,72 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var ConversationDataset $response */ + $response = $conversationDatasetsClient->getConversationDataset($formattedName); + 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..7ae630003275 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..34195388d043 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php @@ -0,0 +1,99 @@ +/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 any non-scalar elements to be passed along with the request. + $inputConfig = new InputConfig(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->importConversationData($formattedName, $inputConfig); + $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..94496edfd14a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationDatasetsClient->listConversationDatasets($formattedParent); + + /** @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..8eed2dab7c09 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..d860bc74438f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php @@ -0,0 +1,109 @@ +/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 any non-scalar elements to be passed along with the request. + $inputDataset = (new InputDataset()) + ->setDataset($formattedConversationModelDatasetsDataset); + $conversationModelDatasets = [$inputDataset,]; + $conversationModel = (new ConversationModel()) + ->setDisplayName($conversationModelDisplayName) + ->setDatasets($conversationModelDatasets); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->createConversationModel($conversationModel); + $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..01fa5edadfaf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php @@ -0,0 +1,90 @@ +/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 any non-scalar elements to be passed along with the request. + $conversationModelEvaluation = new ConversationModelEvaluation(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->createConversationModelEvaluation( + $formattedParent, + $conversationModelEvaluation + ); + $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..e7bf8d38290c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php @@ -0,0 +1,84 @@ +/conversationModels/` + */ +function delete_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->deleteConversationModel($name); + $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..953c43c9be97 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php @@ -0,0 +1,87 @@ +/conversationModels/` + */ +function deploy_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->deployConversationModel($name); + $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..7e452efa6591 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php @@ -0,0 +1,66 @@ +/conversationModels/` + */ +function get_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var ConversationModel $response */ + $response = $conversationModelsClient->getConversationModel($name); + 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..76b76eb683e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php @@ -0,0 +1,67 @@ +/conversationModels//evaluations/` + */ +function get_conversation_model_evaluation_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var ConversationModelEvaluation $response */ + $response = $conversationModelsClient->getConversationModelEvaluation($name); + 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..c1cbdff88eef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..7339240d4d43 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php @@ -0,0 +1,71 @@ +/conversationModels/` + */ +function list_conversation_model_evaluations_sample(string $parent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationModelsClient->listConversationModelEvaluations($parent); + + /** @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..06886c759433 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php @@ -0,0 +1,71 @@ +` + */ +function list_conversation_models_sample(string $parent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationModelsClient->listConversationModels($parent); + + /** @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..6366d82ab9d6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..46282f73ea7f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php @@ -0,0 +1,87 @@ +/conversationModels/` + */ +function undeploy_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->undeployConversationModel($name); + $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..f1acaafdca1b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php @@ -0,0 +1,107 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationProfilesClient->clearSuggestionFeatureConfig( + $conversationProfile, + $participantRole, + $suggestionFeatureType + ); + $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..35bf9f51a8d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php @@ -0,0 +1,83 @@ +/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 any non-scalar elements to be passed along with the request. + $conversationProfile = (new ConversationProfile()) + ->setDisplayName($conversationProfileDisplayName); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->createConversationProfile( + $formattedParent, + $conversationProfile + ); + 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..43eaedb46d5b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php @@ -0,0 +1,69 @@ +/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(); + + // Call the API and handle any network failures. + try { + $conversationProfilesClient->deleteConversationProfile($formattedName); + 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..9b041dbbd200 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php @@ -0,0 +1,71 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->getConversationProfile($formattedName); + 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..8a45817c9f46 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..8ca68b838171 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php @@ -0,0 +1,72 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationProfilesClient->listConversationProfiles($formattedParent); + + /** @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..148aeddbe4fa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..d0d3c9d38e9e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php @@ -0,0 +1,110 @@ +/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 any non-scalar elements to be passed along with the request. + $suggestionFeatureConfig = new SuggestionFeatureConfig(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationProfilesClient->setSuggestionFeatureConfig( + $conversationProfile, + $participantRole, + $suggestionFeatureConfig + ); + $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..b26048c43bfb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php @@ -0,0 +1,79 @@ +setDisplayName($conversationProfileDisplayName); + $updateMask = new FieldMask(); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->updateConversationProfile( + $conversationProfile, + $updateMask + ); + 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..21bae124175b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php @@ -0,0 +1,69 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->completeConversation($formattedName); + 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..0058b3844d75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php @@ -0,0 +1,102 @@ +/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 any non-scalar elements to be passed along with the request. + $conversation = (new Conversation()) + ->setConversationProfile($formattedConversationConversationProfile); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->createConversation($formattedParent, $conversation); + 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_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php new file mode 100644 index 000000000000..09f80e224e5c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php @@ -0,0 +1,98 @@ +/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 any non-scalar elements to be passed along with the request. + $message = (new Message()) + ->setContent($statelessConversationMessagesContent); + $statelessConversationMessages = [$message,]; + $statelessConversation = (new MinimalConversation()) + ->setMessages($statelessConversationMessages) + ->setParent($formattedStatelessConversationParent); + $conversationProfile = (new ConversationProfile()) + ->setDisplayName($conversationProfileDisplayName); + + // Call the API and handle any network failures. + try { + /** @var GenerateStatelessSummaryResponse $response */ + $response = $conversationsClient->generateStatelessSummary( + $statelessConversation, + $conversationProfile + ); + 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/get_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php new file mode 100644 index 000000000000..b2b22f9c1260 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php @@ -0,0 +1,68 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->getConversation($formattedName); + 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..da5654088478 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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/list_conversations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php new file mode 100644 index 000000000000..1a0a89e1d2f6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php @@ -0,0 +1,72 @@ +/locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + */ +function list_conversations_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationsClient->listConversations($formattedParent); + + /** @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..05a399ae5d23 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..844f41f4bf32 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php @@ -0,0 +1,77 @@ + + * [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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationsClient->listMessages($formattedParent); + + /** @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/suggest_conversation_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php new file mode 100644 index 000000000000..5caae9706ccc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php @@ -0,0 +1,70 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var SuggestConversationSummaryResponse $response */ + $response = $conversationsClient->suggestConversationSummary($formattedConversation); + 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..87db832c0b28 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php @@ -0,0 +1,112 @@ +/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 any non-scalar elements to be passed along with the request. + $documentKnowledgeTypes = [$documentKnowledgeTypesElement,]; + $document = (new Document()) + ->setDisplayName($documentDisplayName) + ->setMimeType($documentMimeType) + ->setKnowledgeTypes($documentKnowledgeTypes); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->createDocument($formattedParent, $document); + $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..c9ea62d3ec8e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php @@ -0,0 +1,86 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->deleteDocument($formattedName); + $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..b13f17f549c2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php @@ -0,0 +1,89 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->exportDocument($formattedName); + $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..b121f8bf3e81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php @@ -0,0 +1,68 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $documentsClient->getDocument($formattedName); + 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..88fc99f2603a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..70de52c51255 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php @@ -0,0 +1,110 @@ +/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 any non-scalar elements to be passed along with the request. + $documentTemplateKnowledgeTypes = [$documentTemplateKnowledgeTypesElement,]; + $documentTemplate = (new ImportDocumentTemplate()) + ->setMimeType($documentTemplateMimeType) + ->setKnowledgeTypes($documentTemplateKnowledgeTypes); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->importDocuments($formattedParent, $documentTemplate); + $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..17f89159977c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentsClient->listDocuments($formattedParent); + + /** @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..880cffa907ee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..e99ac519bddc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php @@ -0,0 +1,94 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->reloadDocument($formattedName); + $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..931a71194e3f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php @@ -0,0 +1,101 @@ +setDisplayName($documentDisplayName) + ->setMimeType($documentMimeType) + ->setKnowledgeTypes($documentKnowledgeTypes); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->updateDocument($document); + $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/EntityTypesClient/batch_create_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php new file mode 100644 index 000000000000..09b5645c2a02 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php @@ -0,0 +1,121 @@ +/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 any non-scalar elements to be passed along with the request. + $entitiesSynonyms = [$entitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($entitiesValue) + ->setSynonyms($entitiesSynonyms); + $entities = [$entity,]; + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchCreateEntities($formattedParent, $entities); + $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..cf7d4a263026 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php @@ -0,0 +1,96 @@ +/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 any non-scalar elements to be passed along with the request. + $entityValues = [$entityValuesElement,]; + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchDeleteEntities($formattedParent, $entityValues); + $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..6e8a38460aa6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php @@ -0,0 +1,97 @@ +/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 any non-scalar elements to be passed along with the request. + $entityTypeNames = [$entityTypeNamesElement,]; + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); + $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..4322ae722973 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php @@ -0,0 +1,124 @@ +/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 any non-scalar elements to be passed along with the request. + $entitiesSynonyms = [$entitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($entitiesValue) + ->setSynonyms($entitiesSynonyms); + $entities = [$entity,]; + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchUpdateEntities($formattedParent, $entities); + $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..232403a7967d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php @@ -0,0 +1,92 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchUpdateEntityTypes($formattedParent); + $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..dc4cce6aa718 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php @@ -0,0 +1,84 @@ +/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 any non-scalar elements to be passed along with the request. + $entityType = (new EntityType()) + ->setDisplayName($entityTypeDisplayName) + ->setKind($entityTypeKind); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->createEntityType($formattedParent, $entityType); + 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..5748edf82816 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php @@ -0,0 +1,69 @@ +/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(); + + // Call the API and handle any network failures. + try { + $entityTypesClient->deleteEntityType($formattedName); + 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..b685238b0d6d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php @@ -0,0 +1,67 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->getEntityType($formattedName); + 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..51363603853e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..f15ab41a2438 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php @@ -0,0 +1,72 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $entityTypesClient->listEntityTypes($formattedParent); + + /** @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..bf04677e2266 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..6a8325f6f610 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php @@ -0,0 +1,77 @@ +setDisplayName($entityTypeDisplayName) + ->setKind($entityTypeKind); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->updateEntityType($entityType); + 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..380c9a53b612 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php @@ -0,0 +1,75 @@ +/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 any non-scalar elements to be passed along with the request. + $environment = new Environment(); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->createEnvironment($formattedParent, $environment, $environmentId); + 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..d45813d8fbc0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php @@ -0,0 +1,71 @@ +/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(); + + // Call the API and handle any network failures. + try { + $environmentsClient->deleteEnvironment($formattedName); + 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..3c4e7c3168fa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->getEnvironment($formattedName); + 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..c45844906edc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.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_history_sample(string $formattedParent): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $environmentsClient->getEnvironmentHistory($formattedParent); + + /** @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..27b2a0f62e63 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..100b48c84eb0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php @@ -0,0 +1,75 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $environmentsClient->listEnvironments($formattedParent); + + /** @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..07d7be30e536 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..af5123c261bb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php @@ -0,0 +1,69 @@ +updateEnvironment($environment, $updateMask); + 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..c9c592e7244a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php @@ -0,0 +1,67 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Fulfillment $response */ + $response = $fulfillmentsClient->getFulfillment($formattedName); + 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..c146dfd4f52c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..808b1eff5ec9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..c5d24f04f450 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php @@ -0,0 +1,77 @@ +/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 any non-scalar elements to be passed along with the request. + $fulfillment = (new Fulfillment()) + ->setName($fulfillmentName); + $updateMask = new FieldMask(); + + // Call the API and handle any network failures. + try { + /** @var Fulfillment $response */ + $response = $fulfillmentsClient->updateFulfillment($fulfillment, $updateMask); + 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/IntentsClient/batch_delete_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php new file mode 100644 index 000000000000..0709129cd8d1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php @@ -0,0 +1,97 @@ +/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 any non-scalar elements to be passed along with the request. + $intent = (new Intent()) + ->setDisplayName($intentsDisplayName); + $intents = [$intent,]; + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $intentsClient->batchDeleteIntents($formattedParent, $intents); + $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..a9faa4b5d3a4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php @@ -0,0 +1,92 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $intentsClient->batchUpdateIntents($formattedParent); + $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..2307c22737e6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php @@ -0,0 +1,77 @@ +/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 any non-scalar elements to be passed along with the request. + $intent = (new Intent()) + ->setDisplayName($intentDisplayName); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->createIntent($formattedParent, $intent); + 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..4a3d19ec1f44 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php @@ -0,0 +1,70 @@ +/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(); + + // Call the API and handle any network failures. + try { + $intentsClient->deleteIntent($formattedName); + 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..e6e2fad64fc0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php @@ -0,0 +1,67 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->getIntent($formattedName); + 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..177e67b62277 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..770f91e1140f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php @@ -0,0 +1,80 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $intentsClient->listIntents($formattedParent); + + /** @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..30cb797e8312 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..0b54b3704900 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php @@ -0,0 +1,73 @@ +setDisplayName($intentDisplayName); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->updateIntent($intent); + 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..f6bbbd05697b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php @@ -0,0 +1,76 @@ +/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 any non-scalar elements to be passed along with the request. + $knowledgeBase = (new KnowledgeBase()) + ->setDisplayName($knowledgeBaseDisplayName); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->createKnowledgeBase($formattedParent, $knowledgeBase); + 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..903609bbdc00 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php @@ -0,0 +1,66 @@ +/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(); + + // Call the API and handle any network failures. + try { + $knowledgeBasesClient->deleteKnowledgeBase($formattedName); + 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..bda173eafa0a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php @@ -0,0 +1,68 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->getKnowledgeBase($formattedName); + 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..8362d31264fc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..de802bdfe9c4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php @@ -0,0 +1,72 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $knowledgeBasesClient->listKnowledgeBases($formattedParent); + + /** @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..c20bb9d82c39 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..de83978a7890 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php @@ -0,0 +1,70 @@ +setDisplayName($knowledgeBaseDisplayName); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->updateKnowledgeBase($knowledgeBase); + 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..ea2a07165aaa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php @@ -0,0 +1,77 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var AnalyzeContentResponse $response */ + $response = $participantsClient->analyzeContent($formattedParticipant); + 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..ac93afe4f345 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php @@ -0,0 +1,71 @@ +/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 any non-scalar elements to be passed along with the request. + $participant = new Participant(); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->createParticipant($formattedParent, $participant); + 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..a4717b996ff4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..ed68078dfcf9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php @@ -0,0 +1,72 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->getParticipant($formattedName); + 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..440555880149 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..8359a672d1f7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $participantsClient->listParticipants($formattedParent); + + /** @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..ca78aadb5c28 --- /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 any non-scalar elements to be passed along with the request. + $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..5abba2ea21fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var SuggestArticlesResponse $response */ + $response = $participantsClient->suggestArticles($formattedParent); + 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..305452d83d07 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var SuggestFaqAnswersResponse $response */ + $response = $participantsClient->suggestFaqAnswers($formattedParent); + 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_smart_replies.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php new file mode 100644 index 000000000000..adc3807aeaf4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php @@ -0,0 +1,73 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var SuggestSmartRepliesResponse $response */ + $response = $participantsClient->suggestSmartReplies($formattedParent); + 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..97b1187d7947 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php @@ -0,0 +1,58 @@ +updateParticipant($participant, $updateMask); + 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..b5513f20f7c3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php @@ -0,0 +1,140 @@ +/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 any non-scalar elements to be passed along with the request. + $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($sessionEntityTypeEntitiesValue) + ->setSynonyms($sessionEntityTypeEntitiesSynonyms); + $sessionEntityTypeEntities = [$entity,]; + $sessionEntityType = (new SessionEntityType()) + ->setName($sessionEntityTypeName) + ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) + ->setEntities($sessionEntityTypeEntities); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->createSessionEntityType( + $formattedParent, + $sessionEntityType + ); + 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..b6f56f0de7cf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php @@ -0,0 +1,78 @@ +/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(); + + // Call the API and handle any network failures. + try { + $sessionEntityTypesClient->deleteSessionEntityType($formattedName); + 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..5590902a38e5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..c4ff566fb7fc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php @@ -0,0 +1,80 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->getSessionEntityType($formattedName); + 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..5673a2ad0429 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..57f99fff2eaf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php @@ -0,0 +1,80 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent); + + /** @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..931ba432a559 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php @@ -0,0 +1,124 @@ +/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 any non-scalar elements to be passed along with the request. + $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($sessionEntityTypeEntitiesValue) + ->setSynonyms($sessionEntityTypeEntitiesSynonyms); + $sessionEntityTypeEntities = [$entity,]; + $sessionEntityType = (new SessionEntityType()) + ->setName($sessionEntityTypeName) + ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) + ->setEntities($sessionEntityTypeEntities); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->updateSessionEntityType($sessionEntityType); + 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..569dcb6ebdb2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php @@ -0,0 +1,100 @@ +/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 any non-scalar elements to be passed along with the request. + $queryInput = new QueryInput(); + + // Call the API and handle any network failures. + try { + /** @var DetectIntentResponse $response */ + $response = $sessionsClient->detectIntent($formattedSession, $queryInput); + 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..f12b6d2c5964 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..972718b7fa62 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..9c7a2254b249 --- /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 any non-scalar elements to be passed along with the request. + $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/VersionsClient/create_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php new file mode 100644 index 000000000000..e089e250e1ed --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php @@ -0,0 +1,75 @@ +/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 any non-scalar elements to be passed along with the request. + $version = new Version(); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->createVersion($formattedParent, $version); + 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..0210b6fa6bf1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php @@ -0,0 +1,69 @@ +/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(); + + // Call the API and handle any network failures. + try { + $versionsClient->deleteVersion($formattedName); + 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..2a4e47d09c7c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + 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..9a5a28ce621d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php @@ -0,0 +1,71 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->getVersion($formattedName); + 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..9041a7fb8603 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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..d093ad705a0f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php @@ -0,0 +1,75 @@ +/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(); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $versionsClient->listVersions($formattedParent); + + /** @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..1d7662bb6779 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php @@ -0,0 +1,62 @@ +updateVersion($version, $updateMask); + 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/AgentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php new file mode 100644 index 000000000000..f35575682398 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php @@ -0,0 +1,34 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::deleteAgentAsync()} . + * + * @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 self::exportAgentAsync()} . + * + * @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 self::getAgentAsync()} . + * + * @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 self::getValidationResultAsync()} . + * + * @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 self::importAgentAsync()} . + * + * @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 self::restoreAgentAsync()} . + * + * @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 self::searchAgentsAsync()} . + * + * @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 self::setAgentAsync()} . + * + * @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 self::trainAgentAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/AnswerRecordsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AnswerRecordsBaseClient.php new file mode 100644 index 000000000000..0acca13dc47c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AnswerRecordsBaseClient.php @@ -0,0 +1,390 @@ + 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 + * 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 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_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_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, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - answerRecord: projects/{project}/answerRecords/{answer_record} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} + * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} + * + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::listAnswerRecordsAsync()} . + * + * @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 self::updateAnswerRecordAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/ContextsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ContextsBaseClient.php new file mode 100644 index 000000000000..5e0517939266 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ContextsBaseClient.php @@ -0,0 +1,614 @@ + 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createContextAsync()} . + * + * @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 self::deleteAllContextsAsync()} . + * + * @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 self::deleteContextAsync()} . + * + * @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 self::getContextAsync()} . + * + * @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 self::listContextsAsync()} . + * + * @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 self::updateContextAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/ConversationDatasetsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationDatasetsBaseClient.php new file mode 100644 index 000000000000..000c7bae45c6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationDatasetsBaseClient.php @@ -0,0 +1,487 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createConversationDatasetAsync()} . + * + * @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 self::deleteConversationDatasetAsync()} . + * + * @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 self::getConversationDatasetAsync()} . + * + * @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 self::importConversationDataAsync()} . + * + * @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 self::listConversationDatasetsAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/ConversationModelsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationModelsBaseClient.php new file mode 100644 index 000000000000..9b5bcc80f5a9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationModelsBaseClient.php @@ -0,0 +1,765 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createConversationModelAsync()} . + * + * @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 self::createConversationModelEvaluationAsync()} . + * + * @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 self::deleteConversationModelAsync()} . + * + * @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 self::deployConversationModelAsync()} . + * + * @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 self::getConversationModelAsync()} . + * + * @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 self::getConversationModelEvaluationAsync()} . + * + * @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 self::listConversationModelEvaluationsAsync()} . + * + * @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 self::listConversationModelsAsync()} . + * + * @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 self::undeployConversationModelAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/ConversationProfilesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationProfilesBaseClient.php new file mode 100644 index 000000000000..f6bfdf228752 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationProfilesBaseClient.php @@ -0,0 +1,838 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 + * 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_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} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::clearSuggestionFeatureConfigAsync()} . + * + * @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.CreateTime][] and [ConversationProfile.UpdateTime][] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * The async variant is {@see self::createConversationProfileAsync()} . + * + * @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 self::deleteConversationProfileAsync()} . + * + * @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 self::getConversationProfileAsync()} . + * + * @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 self::listConversationProfilesAsync()} . + * + * @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 self::setSuggestionFeatureConfigAsync()} . + * + * @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.CreateTime][] and [ConversationProfile.UpdateTime][] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * The async variant is {@see self::updateConversationProfileAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/ConversationsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationsBaseClient.php new file mode 100644 index 000000000000..ee5d9a16a590 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationsBaseClient.php @@ -0,0 +1,913 @@ + 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 + * 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 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 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 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_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_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} + * - conversation: projects/{project}/conversations/{conversation} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - 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 + * - 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} + * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::completeConversationAsync()} . + * + * @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 self::createConversationAsync()} . + * + * @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 summary for a conversation that does not have a + * resource created for it. + * + * The async variant is {@see self::generateStatelessSummaryAsync()} . + * + * @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(); + } + + /** + * Retrieves the specific conversation. + * + * The async variant is {@see self::getConversationAsync()} . + * + * @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(); + } + + /** + * Returns the list of all conversations in the specified project. + * + * The async variant is {@see self::listConversationsAsync()} . + * + * @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 self::listMessagesAsync()} . + * + * @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); + } + + /** + * 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 self::suggestConversationSummaryAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/DocumentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/DocumentsBaseClient.php new file mode 100644 index 000000000000..d074c8411169 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/DocumentsBaseClient.php @@ -0,0 +1,669 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createDocumentAsync()} . + * + * @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 self::deleteDocumentAsync()} . + * + * @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 self::exportDocumentAsync()} . + * + * @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 self::getDocumentAsync()} . + * + * @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 self::importDocumentsAsync()} . + * + * @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 self::listDocumentsAsync()} . + * + * @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 self::reloadDocumentAsync()} . + * + * @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 self::updateDocumentAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/EntityTypesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EntityTypesBaseClient.php new file mode 100644 index 000000000000..22566ed48345 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EntityTypesBaseClient.php @@ -0,0 +1,727 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::batchCreateEntitiesAsync()} . + * + * @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 self::batchDeleteEntitiesAsync()} . + * + * @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 self::batchDeleteEntityTypesAsync()} . + * + * @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 self::batchUpdateEntitiesAsync()} . + * + * @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 self::batchUpdateEntityTypesAsync()} . + * + * @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 self::createEntityTypeAsync()} . + * + * @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 self::deleteEntityTypeAsync()} . + * + * @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 self::getEntityTypeAsync()} . + * + * @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 self::listEntityTypesAsync()} . + * + * @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 self::updateEntityTypeAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/EnvironmentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EnvironmentsBaseClient.php new file mode 100644 index 000000000000..211aa964a530 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EnvironmentsBaseClient.php @@ -0,0 +1,623 @@ + 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createEnvironmentAsync()} . + * + * @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 self::deleteEnvironmentAsync()} . + * + * @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 self::getEnvironmentAsync()} . + * + * @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 self::getEnvironmentHistoryAsync()} . + * + * @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 self::listEnvironmentsAsync()} . + * + * @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 self::updateEnvironmentAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/FulfillmentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/FulfillmentsBaseClient.php new file mode 100644 index 000000000000..40f53daa547c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/FulfillmentsBaseClient.php @@ -0,0 +1,348 @@ + 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::getFulfillmentAsync()} . + * + * @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 self::updateFulfillmentAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/IntentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/IntentsBaseClient.php new file mode 100644 index 000000000000..dc8b0443d2ae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/IntentsBaseClient.php @@ -0,0 +1,821 @@ + 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::batchDeleteIntentsAsync()} . + * + * @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 self::batchUpdateIntentsAsync()} . + * + * @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 self::createIntentAsync()} . + * + * @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 self::deleteIntentAsync()} . + * + * @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 self::getIntentAsync()} . + * + * @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 self::listIntentsAsync()} . + * + * @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 self::updateIntentAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/KnowledgeBasesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/KnowledgeBasesBaseClient.php new file mode 100644 index 000000000000..d6346df2d440 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/KnowledgeBasesBaseClient.php @@ -0,0 +1,465 @@ + 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createKnowledgeBaseAsync()} . + * + * @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 self::deleteKnowledgeBaseAsync()} . + * + * @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 self::getKnowledgeBaseAsync()} . + * + * @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 self::listKnowledgeBasesAsync()} . + * + * @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 self::updateKnowledgeBaseAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/ParticipantsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ParticipantsBaseClient.php new file mode 100644 index 000000000000..423b944374a1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ParticipantsBaseClient.php @@ -0,0 +1,1006 @@ + 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 + * 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} + * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::analyzeContentAsync()} . + * + * @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 self::createParticipantAsync()} . + * + * @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 self::getParticipantAsync()} . + * + * @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 self::listParticipantsAsync()} . + * + * @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). + * + * @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 self::suggestArticlesAsync()} . + * + * @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 self::suggestFaqAnswersAsync()} . + * + * @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 smart replies for a participant based on specific historical + * messages. + * + * The async variant is {@see self::suggestSmartRepliesAsync()} . + * + * @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 self::updateParticipantAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/SessionEntityTypesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionEntityTypesBaseClient.php new file mode 100644 index 000000000000..00bb3b2bf189 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionEntityTypesBaseClient.php @@ -0,0 +1,613 @@ + 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createSessionEntityTypeAsync()} . + * + * @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 self::deleteSessionEntityTypeAsync()} . + * + * @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 self::getSessionEntityTypeAsync()} . + * + * @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 self::listSessionEntityTypesAsync()} . + * + * @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 self::updateSessionEntityTypeAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/SessionsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionsBaseClient.php new file mode 100644 index 000000000000..22c6a7be9bf2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionsBaseClient.php @@ -0,0 +1,648 @@ + 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 + * 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} + * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::detectIntentAsync()} . + * + * @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). + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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/BaseClient/VersionsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/VersionsBaseClient.php new file mode 100644 index 000000000000..53f5fac6362b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/VersionsBaseClient.php @@ -0,0 +1,486 @@ + 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $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 self::createVersionAsync()} . + * + * @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 self::deleteVersionAsync()} . + * + * @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 self::getVersionAsync()} . + * + * @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 self::listVersionsAsync()} . + * + * @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 self::updateVersionAsync()} . + * + * @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 self::getLocationAsync()} . + * + * @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. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @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..60ef14d747b8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php @@ -0,0 +1,40 @@ +projectName('[PROJECT]'); + * $agentsClient->deleteAgent($formattedParent); + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\AgentsClient} to use the new surface. + */ +class AgentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Agents'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $locationNameTemplate; + + private static $projectNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project, $location) + { + return self::getLocationNameTemplate()->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($project) + { + return self::getProjectNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Deletes the specified agent. + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $agentsClient->deleteAgent($formattedParent); + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteAgent($parent, array $optionalArgs = []) + { + $request = new DeleteAgentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteAgent', GPBEmpty::class, $optionalArgs, $request)->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] + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $agentUri = 'agent_uri'; + * $operationResponse = $agentsClient->exportAgent($formattedParent, $agentUri); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $agentsClient->exportAgent($formattedParent, $agentUri); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'exportAgent'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent to export is associated with. + * Format: `projects/`. + * @param string $agentUri 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). + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function exportAgent($parent, $agentUri, array $optionalArgs = []) + { + $request = new ExportAgentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setAgentUri($agentUri); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ExportAgent', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Retrieves the specified agent. + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $response = $agentsClient->getAgent($formattedParent); + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Agent + * + * @throws ApiException if the remote call fails + */ + public function getAgent($parent, array $optionalArgs = []) + { + $request = new GetAgentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAgent', Agent::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets agent validation result. Agent validation is performed during + * training time and is updated automatically when training is completed. + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $response = $agentsClient->getValidationResult($formattedParent); + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent is associated with. + * Format: `projects/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $languageCode + * 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. + * @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 \Google\Cloud\Dialogflow\V2\ValidationResult + * + * @throws ApiException if the remote call fails + */ + public function getValidationResult($parent, array $optionalArgs = []) + { + $request = new GetValidationResultRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetValidationResult', ValidationResult::class, $optionalArgs, $request)->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). + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $operationResponse = $agentsClient->importAgent($formattedParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $agentsClient->importAgent($formattedParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'importAgent'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent to import is associated with. + * Format: `projects/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $agentUri + * 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 $agentContent + * Zip compressed raw byte content for agent. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function importAgent($parent, array $optionalArgs = []) + { + $request = new ImportAgentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['agentUri'])) { + $request->setAgentUri($optionalArgs['agentUri']); + } + + if (isset($optionalArgs['agentContent'])) { + $request->setAgentContent($optionalArgs['agentContent']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportAgent', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $operationResponse = $agentsClient->restoreAgent($formattedParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $agentsClient->restoreAgent($formattedParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'restoreAgent'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent to restore is associated with. + * Format: `projects/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $agentUri + * 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 $agentContent + * Zip compressed raw byte content for agent. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function restoreAgent($parent, array $optionalArgs = []) + { + $request = new RestoreAgentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['agentUri'])) { + $request->setAgentUri($optionalArgs['agentUri']); + } + + if (isset($optionalArgs['agentContent'])) { + $request->setAgentContent($optionalArgs['agentContent']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestoreAgent', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $agentsClient->searchAgents($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $agentsClient->searchAgents($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to list agents from. + * Format: `projects/`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function searchAgents($parent, array $optionalArgs = []) + { + $request = new SearchAgentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('SearchAgents', $optionalArgs, SearchAgentsResponse::class, $request); + } + + /** + * 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). + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $agent = new Agent(); + * $response = $agentsClient->setAgent($agent); + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param Agent $agent Required. The agent to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @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 \Google\Cloud\Dialogflow\V2\Agent + * + * @throws ApiException if the remote call fails + */ + public function setAgent($agent, array $optionalArgs = []) + { + $request = new SetAgentRequest(); + $requestParamHeaders = []; + $request->setAgent($agent); + $requestParamHeaders['agent.parent'] = $agent->getParent(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetAgent', Agent::class, $optionalArgs, $request)->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). + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $formattedParent = $agentsClient->projectName('[PROJECT]'); + * $operationResponse = $agentsClient->trainAgent($formattedParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $agentsClient->trainAgent($formattedParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'trainAgent'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project that the agent to train is associated with. + * Format: `projects/`. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function trainAgent($parent, array $optionalArgs = []) + { + $request = new TrainAgentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('TrainAgent', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * $response = $agentsClient->getLocation(); + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $agentsClient = new AgentsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $agentsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $agentsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $agentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php new file mode 100644 index 000000000000..ba926ddd83fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php @@ -0,0 +1,629 @@ +projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $answerRecordsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\AnswerRecordsClient} to use the new surface. + */ +class AnswerRecordsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.AnswerRecords'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $answerRecordNameTemplate; + + private static $locationNameTemplate; + + private static $projectNameTemplate; + + private static $projectAnswerRecordNameTemplate; + + private static $projectLocationAnswerRecordNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAnswerRecordNameTemplate() + { + if (self::$answerRecordNameTemplate == null) { + self::$answerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); + } + + return self::$answerRecordNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectAnswerRecordNameTemplate() + { + if (self::$projectAnswerRecordNameTemplate == null) { + self::$projectAnswerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); + } + + return self::$projectAnswerRecordNameTemplate; + } + + private static function getProjectLocationAnswerRecordNameTemplate() + { + if (self::$projectLocationAnswerRecordNameTemplate == null) { + self::$projectLocationAnswerRecordNameTemplate = new PathTemplate('projects/{project}/locations/{location}/answerRecords/{answer_record}'); + } + + return self::$projectLocationAnswerRecordNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'answerRecord' => self::getAnswerRecordNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAnswerRecord' => self::getProjectAnswerRecordNameTemplate(), + 'projectLocationAnswerRecord' => self::getProjectLocationAnswerRecordNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $answerRecord) + { + return self::getAnswerRecordNameTemplate()->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * 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($project, $location) + { + return self::getLocationNameTemplate()->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($project) + { + return self::getProjectNameTemplate()->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($project, $answerRecord) + { + return self::getProjectAnswerRecordNameTemplate()->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * 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($project, $location, $answerRecord) + { + return self::getProjectLocationAnswerRecordNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - answerRecord: projects/{project}/answerRecords/{answer_record} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} + * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} + * + * 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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Returns the list of all answer records in the specified project in reverse + * chronological order. + * + * Sample code: + * ``` + * $answerRecordsClient = new AnswerRecordsClient(); + * try { + * $formattedParent = $answerRecordsClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $answerRecordsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Optional. Filters to restrict results to specific answer records. + * + * Marked deprecated as it hasn't been, and isn't currently, supported. + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listAnswerRecords($parent, array $optionalArgs = []) + { + $request = new ListAnswerRecordsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListAnswerRecords', $optionalArgs, ListAnswerRecordsResponse::class, $request); + } + + /** + * Updates the specified answer record. + * + * Sample code: + * ``` + * $answerRecordsClient = new AnswerRecordsClient(); + * try { + * $answerRecord = new AnswerRecord(); + * $updateMask = new FieldMask(); + * $response = $answerRecordsClient->updateAnswerRecord($answerRecord, $updateMask); + * } finally { + * $answerRecordsClient->close(); + * } + * ``` + * + * @param AnswerRecord $answerRecord Required. Answer record to update. + * @param FieldMask $updateMask Required. The mask to control which fields get updated. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\AnswerRecord + * + * @throws ApiException if the remote call fails + */ + public function updateAnswerRecord($answerRecord, $updateMask, array $optionalArgs = []) + { + $request = new UpdateAnswerRecordRequest(); + $requestParamHeaders = []; + $request->setAnswerRecord($answerRecord); + $request->setUpdateMask($updateMask); + $requestParamHeaders['answer_record.name'] = $answerRecord->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateAnswerRecord', AnswerRecord::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $answerRecordsClient = new AnswerRecordsClient(); + * try { + * $response = $answerRecordsClient->getLocation(); + * } finally { + * $answerRecordsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $answerRecordsClient = new AnswerRecordsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $answerRecordsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $answerRecordsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $answerRecordsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php new file mode 100644 index 000000000000..91bc011bb2f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php @@ -0,0 +1,977 @@ +sessionName('[PROJECT]', '[SESSION]'); + * $context = new Context(); + * $response = $contextsClient->createContext($formattedParent, $context); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\ContextsClient} to use the new surface. + */ +class ContextsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Contexts'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $contextNameTemplate; + + private static $projectEnvironmentUserSessionNameTemplate; + + private static $projectEnvironmentUserSessionContextNameTemplate; + + private static $projectLocationEnvironmentUserSessionNameTemplate; + + private static $projectLocationEnvironmentUserSessionContextNameTemplate; + + private static $projectLocationSessionNameTemplate; + + private static $projectLocationSessionContextNameTemplate; + + private static $projectSessionNameTemplate; + + private static $projectSessionContextNameTemplate; + + private static $sessionNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getContextNameTemplate() + { + if (self::$contextNameTemplate == null) { + self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$contextNameTemplate; + } + + private static function getProjectEnvironmentUserSessionNameTemplate() + { + if (self::$projectEnvironmentUserSessionNameTemplate == null) { + self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectEnvironmentUserSessionNameTemplate; + } + + private static function getProjectEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { + self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectLocationEnvironmentUserSessionNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectLocationSessionNameTemplate() + { + if (self::$projectLocationSessionNameTemplate == null) { + self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); + } + + return self::$projectLocationSessionNameTemplate; + } + + private static function getProjectLocationSessionContextNameTemplate() + { + if (self::$projectLocationSessionContextNameTemplate == null) { + self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationSessionContextNameTemplate; + } + + private static function getProjectSessionNameTemplate() + { + if (self::$projectSessionNameTemplate == null) { + self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$projectSessionNameTemplate; + } + + private static function getProjectSessionContextNameTemplate() + { + if (self::$projectSessionContextNameTemplate == null) { + self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectSessionContextNameTemplate; + } + + private static function getSessionNameTemplate() + { + if (self::$sessionNameTemplate == null) { + self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$sessionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'context' => self::getContextNameTemplate(), + 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), + 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), + 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), + 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), + 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), + 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), + 'projectSession' => self::getProjectSessionNameTemplate(), + 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), + 'session' => self::getSessionNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $session, $context) + { + return self::getContextNameTemplate()->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($project, $environment, $user, $session) + { + return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) + { + return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $location, $environment, $user, $session) + { + return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) + { + return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $session) + { + return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) + { + return self::getProjectLocationSessionContextNameTemplate()->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($project, $session) + { + return self::getProjectSessionNameTemplate()->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($project, $session, $context) + { + return self::getProjectSessionContextNameTemplate()->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($project, $session) + { + return self::getSessionNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a context. + * + * If the specified context already exists, overrides the context. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $formattedParent = $contextsClient->sessionName('[PROJECT]', '[SESSION]'); + * $context = new Context(); + * $response = $contextsClient->createContext($formattedParent, $context); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @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. + * @param Context $context Required. The context to create. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Context + * + * @throws ApiException if the remote call fails + */ + public function createContext($parent, $context, array $optionalArgs = []) + { + $request = new CreateContextRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setContext($context); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateContext', Context::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes all active contexts in the specified session. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $formattedParent = $contextsClient->sessionName('[PROJECT]', '[SESSION]'); + * $contextsClient->deleteAllContexts($formattedParent); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteAllContexts($parent, array $optionalArgs = []) + { + $request = new DeleteAllContextsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteAllContexts', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the specified context. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $formattedName = $contextsClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + * $contextsClient->deleteContext($formattedName); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteContext($name, array $optionalArgs = []) + { + $request = new DeleteContextRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteContext', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified context. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $formattedName = $contextsClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + * $response = $contextsClient->getContext($formattedName); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Context + * + * @throws ApiException if the remote call fails + */ + public function getContext($name, array $optionalArgs = []) + { + $request = new GetContextRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetContext', Context::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all contexts in the specified session. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $formattedParent = $contextsClient->sessionName('[PROJECT]', '[SESSION]'); + * // Iterate over pages of elements + * $pagedResponse = $contextsClient->listContexts($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $contextsClient->listContexts($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listContexts($parent, array $optionalArgs = []) + { + $request = new ListContextsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListContexts', $optionalArgs, ListContextsResponse::class, $request); + } + + /** + * Updates the specified context. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $context = new Context(); + * $response = $contextsClient->updateContext($context); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @param Context $context Required. The context to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @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 \Google\Cloud\Dialogflow\V2\Context + * + * @throws ApiException if the remote call fails + */ + public function updateContext($context, array $optionalArgs = []) + { + $request = new UpdateContextRequest(); + $requestParamHeaders = []; + $request->setContext($context); + $requestParamHeaders['context.name'] = $context->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateContext', Context::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * $response = $contextsClient->getLocation(); + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $contextsClient = new ContextsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $contextsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $contextsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $contextsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php new file mode 100644 index 000000000000..98a924542928 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php @@ -0,0 +1,817 @@ +createConversationDataset($parent, $conversationDataset); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'createConversationDataset'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\ConversationDatasetsClient} to use the new + * surface. + */ +class ConversationDatasetsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationDatasets'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $conversationDatasetNameTemplate; + + private static $locationNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getConversationDatasetNameTemplate() + { + if (self::$conversationDatasetNameTemplate == null) { + self::$conversationDatasetNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}'); + } + + return self::$conversationDatasetNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'conversationDataset' => self::getConversationDatasetNameTemplate(), + 'location' => self::getLocationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $location, $conversationDataset) + { + return self::getConversationDatasetNameTemplate()->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($project, $location) + { + return self::getLocationNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * 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] + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * $parent = 'parent'; + * $conversationDataset = new ConversationDataset(); + * $operationResponse = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'createConversationDataset'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to create conversation dataset for. Format: + * `projects//locations/` + * @param ConversationDataset $conversationDataset Required. The conversation dataset to create. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createConversationDataset($parent, $conversationDataset, array $optionalArgs = []) + { + $request = new CreateConversationDatasetRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setConversationDataset($conversationDataset); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateConversationDataset', $optionalArgs, $request, $this->getOperationsClient())->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) + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * $formattedName = $conversationDatasetsClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + * $operationResponse = $conversationDatasetsClient->deleteConversationDataset($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationDatasetsClient->deleteConversationDataset($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'deleteConversationDataset'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation dataset to delete. Format: + * `projects//locations//conversationDatasets/` + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteConversationDataset($name, array $optionalArgs = []) + { + $request = new DeleteConversationDatasetRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteConversationDataset', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Retrieves the specified conversation dataset. + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * $formattedName = $conversationDatasetsClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + * $response = $conversationDatasetsClient->getConversationDataset($formattedName); + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation dataset to retrieve. Format: + * `projects//locations//conversationDatasets/` + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\ConversationDataset + * + * @throws ApiException if the remote call fails + */ + public function getConversationDataset($name, array $optionalArgs = []) + { + $request = new GetConversationDatasetRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConversationDataset', ConversationDataset::class, $optionalArgs, $request)->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] + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * $formattedName = $conversationDatasetsClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + * $inputConfig = new InputConfig(); + * $operationResponse = $conversationDatasetsClient->importConversationData($formattedName, $inputConfig); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationDatasetsClient->importConversationData($formattedName, $inputConfig); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'importConversationData'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param string $name Required. Dataset resource name. Format: + * `projects//locations//conversationDatasets/` + * @param InputConfig $inputConfig Required. Configuration describing where to import data from. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function importConversationData($name, $inputConfig, array $optionalArgs = []) + { + $request = new ImportConversationDataRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setInputConfig($inputConfig); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportConversationData', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Returns the list of all conversation datasets in the specified + * project and location. + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * $formattedParent = $conversationDatasetsClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $conversationDatasetsClient->listConversationDatasets($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationDatasetsClient->listConversationDatasets($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location name to list all conversation datasets + * for. Format: `projects//locations/` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConversationDatasets($parent, array $optionalArgs = []) + { + $request = new ListConversationDatasetsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListConversationDatasets', $optionalArgs, ListConversationDatasetsResponse::class, $request); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * $response = $conversationDatasetsClient->getLocation(); + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $conversationDatasetsClient = new ConversationDatasetsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $conversationDatasetsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationDatasetsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationDatasetsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php new file mode 100644 index 000000000000..991b8f7dee23 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php @@ -0,0 +1,1327 @@ +createConversationModel($conversationModel); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationModelsClient->createConversationModel($conversationModel); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'createConversationModel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\ConversationModelsClient} to use the new + * surface. + */ +class ConversationModelsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationModels'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $conversationDatasetNameTemplate; + + private static $conversationModelNameTemplate; + + private static $conversationModelEvaluationNameTemplate; + + private static $documentNameTemplate; + + private static $projectConversationModelNameTemplate; + + private static $projectConversationModelEvaluationNameTemplate; + + private static $projectKnowledgeBaseDocumentNameTemplate; + + private static $projectLocationConversationModelNameTemplate; + + private static $projectLocationConversationModelEvaluationNameTemplate; + + private static $projectLocationKnowledgeBaseDocumentNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getConversationDatasetNameTemplate() + { + if (self::$conversationDatasetNameTemplate == null) { + self::$conversationDatasetNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}'); + } + + return self::$conversationDatasetNameTemplate; + } + + private static function getConversationModelNameTemplate() + { + if (self::$conversationModelNameTemplate == null) { + self::$conversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); + } + + return self::$conversationModelNameTemplate; + } + + private static function getConversationModelEvaluationNameTemplate() + { + if (self::$conversationModelEvaluationNameTemplate == null) { + self::$conversationModelEvaluationNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}'); + } + + return self::$conversationModelEvaluationNameTemplate; + } + + private static function getDocumentNameTemplate() + { + if (self::$documentNameTemplate == null) { + self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$documentNameTemplate; + } + + private static function getProjectConversationModelNameTemplate() + { + if (self::$projectConversationModelNameTemplate == null) { + self::$projectConversationModelNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}'); + } + + return self::$projectConversationModelNameTemplate; + } + + private static function getProjectConversationModelEvaluationNameTemplate() + { + if (self::$projectConversationModelEvaluationNameTemplate == null) { + self::$projectConversationModelEvaluationNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}'); + } + + return self::$projectConversationModelEvaluationNameTemplate; + } + + private static function getProjectKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { + self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectKnowledgeBaseDocumentNameTemplate; + } + + private static function getProjectLocationConversationModelNameTemplate() + { + if (self::$projectLocationConversationModelNameTemplate == null) { + self::$projectLocationConversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); + } + + return self::$projectLocationConversationModelNameTemplate; + } + + private static function getProjectLocationConversationModelEvaluationNameTemplate() + { + if (self::$projectLocationConversationModelEvaluationNameTemplate == null) { + self::$projectLocationConversationModelEvaluationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}'); + } + + return self::$projectLocationConversationModelEvaluationNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { + self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectLocationKnowledgeBaseDocumentNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'conversationDataset' => self::getConversationDatasetNameTemplate(), + 'conversationModel' => self::getConversationModelNameTemplate(), + 'conversationModelEvaluation' => self::getConversationModelEvaluationNameTemplate(), + 'document' => self::getDocumentNameTemplate(), + 'projectConversationModel' => self::getProjectConversationModelNameTemplate(), + 'projectConversationModelEvaluation' => self::getProjectConversationModelEvaluationNameTemplate(), + 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), + 'projectLocationConversationModel' => self::getProjectLocationConversationModelNameTemplate(), + 'projectLocationConversationModelEvaluation' => self::getProjectLocationConversationModelEvaluationNameTemplate(), + 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $location, $conversationDataset) + { + return self::getConversationDatasetNameTemplate()->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($project, $location, $conversationModel) + { + return self::getConversationModelNameTemplate()->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($project, $conversationModel, $evaluation) + { + return self::getConversationModelEvaluationNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getDocumentNameTemplate()->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($project, $conversationModel) + { + return self::getProjectConversationModelNameTemplate()->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($project, $conversationModel, $evaluation) + { + return self::getProjectConversationModelEvaluationNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location, $conversationModel) + { + return self::getProjectLocationConversationModelNameTemplate()->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($project, $location, $conversationModel, $evaluation) + { + return self::getProjectLocationConversationModelEvaluationNameTemplate()->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($project, $location, $knowledgeBase, $document) + { + return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * 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] + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $conversationModel = new ConversationModel(); + * $operationResponse = $conversationModelsClient->createConversationModel($conversationModel); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationModelsClient->createConversationModel($conversationModel); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'createConversationModel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param ConversationModel $conversationModel Required. The conversation model to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $parent + * The project to create conversation model for. Format: + * `projects/` + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createConversationModel($conversationModel, array $optionalArgs = []) + { + $request = new CreateConversationModelRequest(); + $requestParamHeaders = []; + $request->setConversationModel($conversationModel); + if (isset($optionalArgs['parent'])) { + $request->setParent($optionalArgs['parent']); + $requestParamHeaders['parent'] = $optionalArgs['parent']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateConversationModel', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates evaluation of a conversation model. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $formattedParent = $conversationModelsClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); + * $conversationModelEvaluation = new ConversationModelEvaluation(); + * $operationResponse = $conversationModelsClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationModelsClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'createConversationModelEvaluation'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $parent Required. The conversation model resource name. Format: + * `projects//locations//conversationModels/` + * @param ConversationModelEvaluation $conversationModelEvaluation Required. The conversation model evaluation to be created. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createConversationModelEvaluation($parent, $conversationModelEvaluation, array $optionalArgs = []) + { + $request = new CreateConversationModelEvaluationRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setConversationModelEvaluation($conversationModelEvaluation); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateConversationModelEvaluation', $optionalArgs, $request, $this->getOperationsClient())->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) + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $name = 'name'; + * $operationResponse = $conversationModelsClient->deleteConversationModel($name); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationModelsClient->deleteConversationModel($name); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'deleteConversationModel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation model to delete. Format: + * `projects//conversationModels/` + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteConversationModel($name, array $optionalArgs = []) + { + $request = new DeleteConversationModelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteConversationModel', $optionalArgs, $request, $this->getOperationsClient())->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) + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $name = 'name'; + * $operationResponse = $conversationModelsClient->deployConversationModel($name); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationModelsClient->deployConversationModel($name); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'deployConversationModel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation model to deploy. Format: + * `projects//conversationModels/` + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deployConversationModel($name, array $optionalArgs = []) + { + $request = new DeployConversationModelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeployConversationModel', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets conversation model. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $name = 'name'; + * $response = $conversationModelsClient->getConversationModel($name); + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation model to retrieve. Format: + * `projects//conversationModels/` + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\ConversationModel + * + * @throws ApiException if the remote call fails + */ + public function getConversationModel($name, array $optionalArgs = []) + { + $request = new GetConversationModelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConversationModel', ConversationModel::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets an evaluation of conversation model. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $name = 'name'; + * $response = $conversationModelsClient->getConversationModelEvaluation($name); + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation model evaluation resource name. Format: + * `projects//conversationModels//evaluations/` + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation + * + * @throws ApiException if the remote call fails + */ + public function getConversationModelEvaluation($name, array $optionalArgs = []) + { + $request = new GetConversationModelEvaluationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConversationModelEvaluation', ConversationModelEvaluation::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists evaluations of a conversation model. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $conversationModelsClient->listConversationModelEvaluations($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationModelsClient->listConversationModelEvaluations($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $parent Required. The conversation model resource name. Format: + * `projects//conversationModels/` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConversationModelEvaluations($parent, array $optionalArgs = []) + { + $request = new ListConversationModelEvaluationsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListConversationModelEvaluations', $optionalArgs, ListConversationModelEvaluationsResponse::class, $request); + } + + /** + * Lists conversation models. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $conversationModelsClient->listConversationModels($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationModelsClient->listConversationModels($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to list all conversation models for. + * Format: `projects/` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConversationModels($parent, array $optionalArgs = []) + { + $request = new ListConversationModelsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListConversationModels', $optionalArgs, ListConversationModelsResponse::class, $request); + } + + /** + * 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) + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $name = 'name'; + * $operationResponse = $conversationModelsClient->undeployConversationModel($name); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationModelsClient->undeployConversationModel($name); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'undeployConversationModel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param string $name Required. The conversation model to undeploy. Format: + * `projects//conversationModels/` + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function undeployConversationModel($name, array $optionalArgs = []) + { + $request = new UndeployConversationModelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UndeployConversationModel', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * $response = $conversationModelsClient->getLocation(); + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $conversationModelsClient = new ConversationModelsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $conversationModelsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationModelsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationModelsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php new file mode 100644 index 000000000000..6b257ddf013a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php @@ -0,0 +1,1389 @@ +clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationProfilesClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationProfilesClient->resumeOperation($operationName, 'clearSuggestionFeatureConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\ConversationProfilesClient} to use the new + * surface. + */ +class ConversationProfilesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationProfiles'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $cXSecuritySettingsNameTemplate; + + private static $conversationModelNameTemplate; + + private static $conversationProfileNameTemplate; + + private static $documentNameTemplate; + + private static $knowledgeBaseNameTemplate; + + private static $locationNameTemplate; + + private static $projectNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectConversationModelNameTemplate; + + private static $projectConversationProfileNameTemplate; + + private static $projectKnowledgeBaseNameTemplate; + + private static $projectKnowledgeBaseDocumentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationConversationModelNameTemplate; + + private static $projectLocationConversationProfileNameTemplate; + + private static $projectLocationKnowledgeBaseNameTemplate; + + private static $projectLocationKnowledgeBaseDocumentNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getCXSecuritySettingsNameTemplate() + { + if (self::$cXSecuritySettingsNameTemplate == null) { + self::$cXSecuritySettingsNameTemplate = new PathTemplate('projects/{project}/locations/{location}/securitySettings/{security_settings}'); + } + + return self::$cXSecuritySettingsNameTemplate; + } + + private static function getConversationModelNameTemplate() + { + if (self::$conversationModelNameTemplate == null) { + self::$conversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); + } + + return self::$conversationModelNameTemplate; + } + + private static function getConversationProfileNameTemplate() + { + if (self::$conversationProfileNameTemplate == null) { + self::$conversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); + } + + return self::$conversationProfileNameTemplate; + } + + private static function getDocumentNameTemplate() + { + if (self::$documentNameTemplate == null) { + self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$documentNameTemplate; + } + + private static function getKnowledgeBaseNameTemplate() + { + if (self::$knowledgeBaseNameTemplate == null) { + self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$knowledgeBaseNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectConversationModelNameTemplate() + { + if (self::$projectConversationModelNameTemplate == null) { + self::$projectConversationModelNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}'); + } + + return self::$projectConversationModelNameTemplate; + } + + private static function getProjectConversationProfileNameTemplate() + { + if (self::$projectConversationProfileNameTemplate == null) { + self::$projectConversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); + } + + return self::$projectConversationProfileNameTemplate; + } + + private static function getProjectKnowledgeBaseNameTemplate() + { + if (self::$projectKnowledgeBaseNameTemplate == null) { + self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectKnowledgeBaseNameTemplate; + } + + private static function getProjectKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { + self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectKnowledgeBaseDocumentNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getProjectLocationConversationModelNameTemplate() + { + if (self::$projectLocationConversationModelNameTemplate == null) { + self::$projectLocationConversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); + } + + return self::$projectLocationConversationModelNameTemplate; + } + + private static function getProjectLocationConversationProfileNameTemplate() + { + if (self::$projectLocationConversationProfileNameTemplate == null) { + self::$projectLocationConversationProfileNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}'); + } + + return self::$projectLocationConversationProfileNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseNameTemplate() + { + if (self::$projectLocationKnowledgeBaseNameTemplate == null) { + self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectLocationKnowledgeBaseNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { + self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectLocationKnowledgeBaseDocumentNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'cXSecuritySettings' => self::getCXSecuritySettingsNameTemplate(), + 'conversationModel' => self::getConversationModelNameTemplate(), + 'conversationProfile' => self::getConversationProfileNameTemplate(), + 'document' => self::getDocumentNameTemplate(), + 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectConversationModel' => self::getProjectConversationModelNameTemplate(), + 'projectConversationProfile' => self::getProjectConversationProfileNameTemplate(), + 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), + 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationConversationModel' => self::getProjectLocationConversationModelNameTemplate(), + 'projectLocationConversationProfile' => self::getProjectLocationConversationProfileNameTemplate(), + 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), + 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project, $location, $securitySettings) + { + return self::getCXSecuritySettingsNameTemplate()->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($project, $location, $conversationModel) + { + return self::getConversationModelNameTemplate()->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($project, $conversationProfile) + { + return self::getConversationProfileNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getDocumentNameTemplate()->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($project, $knowledgeBase) + { + return self::getKnowledgeBaseNameTemplate()->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($project, $location) + { + return self::getLocationNameTemplate()->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($project) + { + return self::getProjectNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $conversationModel) + { + return self::getProjectConversationModelNameTemplate()->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($project, $conversationProfile) + { + return self::getProjectConversationProfileNameTemplate()->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($project, $knowledgeBase) + { + return self::getProjectKnowledgeBaseNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->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($project, $location, $conversationModel) + { + return self::getProjectLocationConversationModelNameTemplate()->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($project, $location, $conversationProfile) + { + return self::getProjectLocationConversationProfileNameTemplate()->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($project, $location, $knowledgeBase) + { + return self::getProjectLocationKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase, $document) + { + return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - 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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * 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] + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $conversationProfile = 'conversation_profile'; + * $participantRole = Role::ROLE_UNSPECIFIED; + * $suggestionFeatureType = Type::TYPE_UNSPECIFIED; + * $operationResponse = $conversationProfilesClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationProfilesClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationProfilesClient->resumeOperation($operationName, 'clearSuggestionFeatureConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @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} + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType, array $optionalArgs = []) + { + $request = new ClearSuggestionFeatureConfigRequest(); + $requestParamHeaders = []; + $request->setConversationProfile($conversationProfile); + $request->setParticipantRole($participantRole); + $request->setSuggestionFeatureType($suggestionFeatureType); + $requestParamHeaders['conversation_profile'] = $conversationProfile; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ClearSuggestionFeatureConfig', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a conversation profile in the specified project. + * + * [ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $formattedParent = $conversationProfilesClient->projectName('[PROJECT]'); + * $conversationProfile = new ConversationProfile(); + * $response = $conversationProfilesClient->createConversationProfile($formattedParent, $conversationProfile); + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @param ConversationProfile $conversationProfile Required. The conversation profile to create. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\ConversationProfile + * + * @throws ApiException if the remote call fails + */ + public function createConversationProfile($parent, $conversationProfile, array $optionalArgs = []) + { + $request = new CreateConversationProfileRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setConversationProfile($conversationProfile); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateConversationProfile', ConversationProfile::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the specified conversation profile. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $formattedName = $conversationProfilesClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + * $conversationProfilesClient->deleteConversationProfile($formattedName); + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteConversationProfile($name, array $optionalArgs = []) + { + $request = new DeleteConversationProfileRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteConversationProfile', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified conversation profile. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $formattedName = $conversationProfilesClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + * $response = $conversationProfilesClient->getConversationProfile($formattedName); + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\ConversationProfile + * + * @throws ApiException if the remote call fails + */ + public function getConversationProfile($name, array $optionalArgs = []) + { + $request = new GetConversationProfileRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConversationProfile', ConversationProfile::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all conversation profiles in the specified project. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $formattedParent = $conversationProfilesClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $conversationProfilesClient->listConversationProfiles($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationProfilesClient->listConversationProfiles($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConversationProfiles($parent, array $optionalArgs = []) + { + $request = new ListConversationProfilesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListConversationProfiles', $optionalArgs, ListConversationProfilesResponse::class, $request); + } + + /** + * 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. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $conversationProfile = 'conversation_profile'; + * $participantRole = Role::ROLE_UNSPECIFIED; + * $suggestionFeatureConfig = new SuggestionFeatureConfig(); + * $operationResponse = $conversationProfilesClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $conversationProfilesClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $conversationProfilesClient->resumeOperation($operationName, 'setSuggestionFeatureConfig'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @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 SuggestionFeatureConfig $suggestionFeatureConfig Required. The suggestion feature config to add or update. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig, array $optionalArgs = []) + { + $request = new SetSuggestionFeatureConfigRequest(); + $requestParamHeaders = []; + $request->setConversationProfile($conversationProfile); + $request->setParticipantRole($participantRole); + $request->setSuggestionFeatureConfig($suggestionFeatureConfig); + $requestParamHeaders['conversation_profile'] = $conversationProfile; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetSuggestionFeatureConfig', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates the specified conversation profile. + * + * [ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] + * aren't populated in the response. You can retrieve them via + * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + * API. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $conversationProfile = new ConversationProfile(); + * $updateMask = new FieldMask(); + * $response = $conversationProfilesClient->updateConversationProfile($conversationProfile, $updateMask); + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param ConversationProfile $conversationProfile Required. The conversation profile to update. + * @param FieldMask $updateMask Required. The mask to control which fields to update. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\ConversationProfile + * + * @throws ApiException if the remote call fails + */ + public function updateConversationProfile($conversationProfile, $updateMask, array $optionalArgs = []) + { + $request = new UpdateConversationProfileRequest(); + $requestParamHeaders = []; + $request->setConversationProfile($conversationProfile); + $request->setUpdateMask($updateMask); + $requestParamHeaders['conversation_profile.name'] = $conversationProfile->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateConversationProfile', ConversationProfile::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * $response = $conversationProfilesClient->getLocation(); + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $conversationProfilesClient = new ConversationProfilesClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $conversationProfilesClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationProfilesClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationProfilesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php new file mode 100644 index 000000000000..7fd787a82291 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php @@ -0,0 +1,1565 @@ +conversationName('[PROJECT]', '[CONVERSATION]'); + * $response = $conversationsClient->completeConversation($formattedName); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\ConversationsClient} to use the new surface. + */ +class ConversationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Conversations'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $cXSecuritySettingsNameTemplate; + + private static $conversationNameTemplate; + + private static $conversationModelNameTemplate; + + private static $conversationProfileNameTemplate; + + private static $documentNameTemplate; + + private static $knowledgeBaseNameTemplate; + + private static $locationNameTemplate; + + private static $messageNameTemplate; + + private static $projectNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectConversationNameTemplate; + + private static $projectConversationMessageNameTemplate; + + private static $projectConversationModelNameTemplate; + + private static $projectConversationProfileNameTemplate; + + private static $projectKnowledgeBaseNameTemplate; + + private static $projectKnowledgeBaseDocumentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationConversationNameTemplate; + + private static $projectLocationConversationMessageNameTemplate; + + private static $projectLocationConversationModelNameTemplate; + + private static $projectLocationConversationProfileNameTemplate; + + private static $projectLocationKnowledgeBaseNameTemplate; + + private static $projectLocationKnowledgeBaseDocumentNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getCXSecuritySettingsNameTemplate() + { + if (self::$cXSecuritySettingsNameTemplate == null) { + self::$cXSecuritySettingsNameTemplate = new PathTemplate('projects/{project}/locations/{location}/securitySettings/{security_settings}'); + } + + return self::$cXSecuritySettingsNameTemplate; + } + + private static function getConversationNameTemplate() + { + if (self::$conversationNameTemplate == null) { + self::$conversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); + } + + return self::$conversationNameTemplate; + } + + private static function getConversationModelNameTemplate() + { + if (self::$conversationModelNameTemplate == null) { + self::$conversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); + } + + return self::$conversationModelNameTemplate; + } + + private static function getConversationProfileNameTemplate() + { + if (self::$conversationProfileNameTemplate == null) { + self::$conversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); + } + + return self::$conversationProfileNameTemplate; + } + + private static function getDocumentNameTemplate() + { + if (self::$documentNameTemplate == null) { + self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$documentNameTemplate; + } + + private static function getKnowledgeBaseNameTemplate() + { + if (self::$knowledgeBaseNameTemplate == null) { + self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$knowledgeBaseNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getMessageNameTemplate() + { + if (self::$messageNameTemplate == null) { + self::$messageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); + } + + return self::$messageNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectConversationNameTemplate() + { + if (self::$projectConversationNameTemplate == null) { + self::$projectConversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); + } + + return self::$projectConversationNameTemplate; + } + + private static function getProjectConversationMessageNameTemplate() + { + if (self::$projectConversationMessageNameTemplate == null) { + self::$projectConversationMessageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); + } + + return self::$projectConversationMessageNameTemplate; + } + + private static function getProjectConversationModelNameTemplate() + { + if (self::$projectConversationModelNameTemplate == null) { + self::$projectConversationModelNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}'); + } + + return self::$projectConversationModelNameTemplate; + } + + private static function getProjectConversationProfileNameTemplate() + { + if (self::$projectConversationProfileNameTemplate == null) { + self::$projectConversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); + } + + return self::$projectConversationProfileNameTemplate; + } + + private static function getProjectKnowledgeBaseNameTemplate() + { + if (self::$projectKnowledgeBaseNameTemplate == null) { + self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectKnowledgeBaseNameTemplate; + } + + private static function getProjectKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { + self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectKnowledgeBaseDocumentNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getProjectLocationConversationNameTemplate() + { + if (self::$projectLocationConversationNameTemplate == null) { + self::$projectLocationConversationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}'); + } + + return self::$projectLocationConversationNameTemplate; + } + + private static function getProjectLocationConversationMessageNameTemplate() + { + if (self::$projectLocationConversationMessageNameTemplate == null) { + self::$projectLocationConversationMessageNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}'); + } + + return self::$projectLocationConversationMessageNameTemplate; + } + + private static function getProjectLocationConversationModelNameTemplate() + { + if (self::$projectLocationConversationModelNameTemplate == null) { + self::$projectLocationConversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); + } + + return self::$projectLocationConversationModelNameTemplate; + } + + private static function getProjectLocationConversationProfileNameTemplate() + { + if (self::$projectLocationConversationProfileNameTemplate == null) { + self::$projectLocationConversationProfileNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}'); + } + + return self::$projectLocationConversationProfileNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseNameTemplate() + { + if (self::$projectLocationKnowledgeBaseNameTemplate == null) { + self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectLocationKnowledgeBaseNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { + self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectLocationKnowledgeBaseDocumentNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'cXSecuritySettings' => self::getCXSecuritySettingsNameTemplate(), + 'conversation' => self::getConversationNameTemplate(), + 'conversationModel' => self::getConversationModelNameTemplate(), + 'conversationProfile' => self::getConversationProfileNameTemplate(), + 'document' => self::getDocumentNameTemplate(), + 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'message' => self::getMessageNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectConversation' => self::getProjectConversationNameTemplate(), + 'projectConversationMessage' => self::getProjectConversationMessageNameTemplate(), + 'projectConversationModel' => self::getProjectConversationModelNameTemplate(), + 'projectConversationProfile' => self::getProjectConversationProfileNameTemplate(), + 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), + 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationConversation' => self::getProjectLocationConversationNameTemplate(), + 'projectLocationConversationMessage' => self::getProjectLocationConversationMessageNameTemplate(), + 'projectLocationConversationModel' => self::getProjectLocationConversationModelNameTemplate(), + 'projectLocationConversationProfile' => self::getProjectLocationConversationProfileNameTemplate(), + 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), + 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project, $location, $securitySettings) + { + return self::getCXSecuritySettingsNameTemplate()->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($project, $conversation) + { + return self::getConversationNameTemplate()->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($project, $location, $conversationModel) + { + return self::getConversationModelNameTemplate()->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($project, $conversationProfile) + { + return self::getConversationProfileNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getDocumentNameTemplate()->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($project, $knowledgeBase) + { + return self::getKnowledgeBaseNameTemplate()->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($project, $location) + { + return self::getLocationNameTemplate()->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($project, $conversation, $message) + { + return self::getMessageNameTemplate()->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * 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($project) + { + return self::getProjectNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $conversation) + { + return self::getProjectConversationNameTemplate()->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($project, $conversation, $message) + { + return self::getProjectConversationMessageNameTemplate()->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($project, $conversationModel) + { + return self::getProjectConversationModelNameTemplate()->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($project, $conversationProfile) + { + return self::getProjectConversationProfileNameTemplate()->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($project, $knowledgeBase) + { + return self::getProjectKnowledgeBaseNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * 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($project, $location, $conversation) + { + return self::getProjectLocationConversationNameTemplate()->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($project, $location, $conversation, $message) + { + return self::getProjectLocationConversationMessageNameTemplate()->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($project, $location, $conversationModel) + { + return self::getProjectLocationConversationModelNameTemplate()->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($project, $location, $conversationProfile) + { + return self::getProjectLocationConversationProfileNameTemplate()->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($project, $location, $knowledgeBase) + { + return self::getProjectLocationKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase, $document) + { + return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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} + * - conversation: projects/{project}/conversations/{conversation} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - 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 + * - 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} + * - 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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedName = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); + * $response = $conversationsClient->completeConversation($formattedName); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $name Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Conversation + * + * @throws ApiException if the remote call fails + */ + public function completeConversation($name, array $optionalArgs = []) + { + $request = new CompleteConversationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CompleteConversation', Conversation::class, $optionalArgs, $request)->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. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedParent = $conversationsClient->projectName('[PROJECT]'); + * $conversation = new Conversation(); + * $response = $conversationsClient->createConversation($formattedParent, $conversation); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * @param Conversation $conversation Required. The conversation to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $conversationId + * 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 fomula + * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * If the field is provided, the caller is resposible 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. + * @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 \Google\Cloud\Dialogflow\V2\Conversation + * + * @throws ApiException if the remote call fails + */ + public function createConversation($parent, $conversation, array $optionalArgs = []) + { + $request = new CreateConversationRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setConversation($conversation); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['conversationId'])) { + $request->setConversationId($optionalArgs['conversationId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateConversation', Conversation::class, $optionalArgs, $request)->wait(); + } + + /** + * Generates and returns a summary for a conversation that does not have a + * resource created for it. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $statelessConversation = new MinimalConversation(); + * $conversationProfile = new ConversationProfile(); + * $response = $conversationsClient->generateStatelessSummary($statelessConversation, $conversationProfile); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param MinimalConversation $statelessConversation Required. The conversation to suggest a summary for. + * @param ConversationProfile $conversationProfile Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * @param array $optionalArgs { + * Optional. + * + * @type string $latestMessage + * 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 $maxContextSize + * 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 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 \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse + * + * @throws ApiException if the remote call fails + */ + public function generateStatelessSummary($statelessConversation, $conversationProfile, array $optionalArgs = []) + { + $request = new GenerateStatelessSummaryRequest(); + $requestParamHeaders = []; + $request->setStatelessConversation($statelessConversation); + $request->setConversationProfile($conversationProfile); + $requestParamHeaders['stateless_conversation.parent'] = $statelessConversation->getParent(); + if (isset($optionalArgs['latestMessage'])) { + $request->setLatestMessage($optionalArgs['latestMessage']); + } + + if (isset($optionalArgs['maxContextSize'])) { + $request->setMaxContextSize($optionalArgs['maxContextSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GenerateStatelessSummary', GenerateStatelessSummaryResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specific conversation. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedName = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); + * $response = $conversationsClient->getConversation($formattedName); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Conversation + * + * @throws ApiException if the remote call fails + */ + public function getConversation($name, array $optionalArgs = []) + { + $request = new GetConversationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetConversation', Conversation::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all conversations in the specified project. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedParent = $conversationsClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $conversationsClient->listConversations($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationsClient->listConversations($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * A filter expression that filters conversations listed in the response. In + * general, the expression must specify the field name, a comparison operator, + * and the value to use for filtering: + *
    + *
  • The value must be a string, a number, or a boolean.
  • + *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • + *
  • To filter on multiple expressions, separate the + * expressions with `AND` or `OR` (omitting both implies `AND`).
  • + *
  • For clarity, expressions can be enclosed in parentheses.
  • + *
+ * 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). + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConversations($parent, array $optionalArgs = []) + { + $request = new ListConversationsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListConversations', $optionalArgs, ListConversationsResponse::class, $request); + } + + /** + * 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. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedParent = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); + * // Iterate over pages of elements + * $pagedResponse = $conversationsClient->listMessages($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationsClient->listMessages($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param array $optionalArgs { + * Optional. + * + * @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 $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listMessages($parent, array $optionalArgs = []) + { + $request = new ListMessagesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListMessages', $optionalArgs, ListMessagesResponse::class, $request); + } + + /** + * 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. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedConversation = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); + * $response = $conversationsClient->suggestConversationSummary($formattedConversation); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $conversation Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $latestMessage + * 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 $contextSize + * 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 AssistQueryParameters $assistQueryParams + * Parameters for a human assist query. Only used for POC/demo purpose. + * @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 \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse + * + * @throws ApiException if the remote call fails + */ + public function suggestConversationSummary($conversation, array $optionalArgs = []) + { + $request = new SuggestConversationSummaryRequest(); + $requestParamHeaders = []; + $request->setConversation($conversation); + $requestParamHeaders['conversation'] = $conversation; + if (isset($optionalArgs['latestMessage'])) { + $request->setLatestMessage($optionalArgs['latestMessage']); + } + + if (isset($optionalArgs['contextSize'])) { + $request->setContextSize($optionalArgs['contextSize']); + } + + if (isset($optionalArgs['assistQueryParams'])) { + $request->setAssistQueryParams($optionalArgs['assistQueryParams']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SuggestConversationSummary', SuggestConversationSummaryResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $response = $conversationsClient->getLocation(); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $conversationsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $conversationsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php new file mode 100644 index 000000000000..19c416d657f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php @@ -0,0 +1,1269 @@ +knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + * $document = new Document(); + * $operationResponse = $documentsClient->createDocument($formattedParent, $document); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->createDocument($formattedParent, $document); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'createDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\DocumentsClient} to use the new surface. + */ +class DocumentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Documents'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $documentNameTemplate; + + private static $knowledgeBaseNameTemplate; + + private static $projectKnowledgeBaseNameTemplate; + + private static $projectKnowledgeBaseDocumentNameTemplate; + + private static $projectLocationKnowledgeBaseNameTemplate; + + private static $projectLocationKnowledgeBaseDocumentNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getDocumentNameTemplate() + { + if (self::$documentNameTemplate == null) { + self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$documentNameTemplate; + } + + private static function getKnowledgeBaseNameTemplate() + { + if (self::$knowledgeBaseNameTemplate == null) { + self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$knowledgeBaseNameTemplate; + } + + private static function getProjectKnowledgeBaseNameTemplate() + { + if (self::$projectKnowledgeBaseNameTemplate == null) { + self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectKnowledgeBaseNameTemplate; + } + + private static function getProjectKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { + self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectKnowledgeBaseDocumentNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseNameTemplate() + { + if (self::$projectLocationKnowledgeBaseNameTemplate == null) { + self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectLocationKnowledgeBaseNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() + { + if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { + self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); + } + + return self::$projectLocationKnowledgeBaseDocumentNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'document' => self::getDocumentNameTemplate(), + 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), + 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), + 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), + 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), + 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $knowledgeBase, $document) + { + return self::getDocumentNameTemplate()->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($project, $knowledgeBase) + { + return self::getKnowledgeBaseNameTemplate()->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($project, $knowledgeBase) + { + return self::getProjectKnowledgeBaseNameTemplate()->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($project, $knowledgeBase, $document) + { + return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location, $knowledgeBase) + { + return self::getProjectLocationKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase, $document) + { + return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * 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] + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedParent = $documentsClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + * $document = new Document(); + * $operationResponse = $documentsClient->createDocument($formattedParent, $document); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->createDocument($formattedParent, $document); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'createDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * @param Document $document Required. The document to create. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createDocument($parent, $document, array $optionalArgs = []) + { + $request = new CreateDocumentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setDocument($document); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateDocument', $optionalArgs, $request, $this->getOperationsClient())->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) + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + * $operationResponse = $documentsClient->deleteDocument($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->deleteDocument($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'deleteDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteDocument($name, array $optionalArgs = []) + { + $request = new DeleteDocumentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteDocument', $optionalArgs, $request, $this->getOperationsClient())->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] + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + * $operationResponse = $documentsClient->exportDocument($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->exportDocument($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'exportDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the document to export. + * Format: `projects//locations//knowledgeBases//documents/`. + * @param array $optionalArgs { + * Optional. + * + * @type GcsDestination $gcsDestination + * Cloud Storage file path to export the document. + * @type bool $exportFullContent + * When enabled, export the full content of the document including empirical + * probability. + * @type bool $smartMessagingPartialUpdate + * When enabled, export the smart messaging allowlist document for partial + * update. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function exportDocument($name, array $optionalArgs = []) + { + $request = new ExportDocumentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['gcsDestination'])) { + $request->setGcsDestination($optionalArgs['gcsDestination']); + } + + if (isset($optionalArgs['exportFullContent'])) { + $request->setExportFullContent($optionalArgs['exportFullContent']); + } + + if (isset($optionalArgs['smartMessagingPartialUpdate'])) { + $request->setSmartMessagingPartialUpdate($optionalArgs['smartMessagingPartialUpdate']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ExportDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Retrieves the specified document. + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + * $response = $documentsClient->getDocument($formattedName); + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Document + * + * @throws ApiException if the remote call fails + */ + public function getDocument($name, array $optionalArgs = []) + { + $request = new GetDocumentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetDocument', Document::class, $optionalArgs, $request)->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] + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedParent = $documentsClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + * $documentTemplate = new ImportDocumentTemplate(); + * $operationResponse = $documentsClient->importDocuments($formattedParent, $documentTemplate); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->importDocuments($formattedParent, $documentTemplate); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'importDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * @param ImportDocumentTemplate $documentTemplate Required. Document template used for importing all the documents. + * @param array $optionalArgs { + * Optional. + * + * @type GcsSources $gcsSource + * Optional. The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * @type bool $importGcsCustomMetadata + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function importDocuments($parent, $documentTemplate, array $optionalArgs = []) + { + $request = new ImportDocumentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setDocumentTemplate($documentTemplate); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['gcsSource'])) { + $request->setGcsSource($optionalArgs['gcsSource']); + } + + if (isset($optionalArgs['importGcsCustomMetadata'])) { + $request->setImportGcsCustomMetadata($optionalArgs['importGcsCustomMetadata']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Returns the list of all documents of the knowledge base. + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedParent = $documentsClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + * // Iterate over pages of elements + * $pagedResponse = $documentsClient->listDocuments($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentsClient->listDocuments($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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). + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listDocuments($parent, array $optionalArgs = []) + { + $request = new ListDocumentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListDocuments', $optionalArgs, ListDocumentsResponse::class, $request); + } + + /** + * 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`. + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + * $operationResponse = $documentsClient->reloadDocument($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->reloadDocument($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'reloadDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * @param array $optionalArgs { + * Optional. + * + * @type 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:///`. + * @type bool $importGcsCustomMetadata + * Optional. Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * @type bool $smartMessagingPartialUpdate + * Optional. When enabled, the reload request is to apply partial update to + * the smart messaging allowlist. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function reloadDocument($name, array $optionalArgs = []) + { + $request = new ReloadDocumentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['contentUri'])) { + $request->setContentUri($optionalArgs['contentUri']); + } + + if (isset($optionalArgs['importGcsCustomMetadata'])) { + $request->setImportGcsCustomMetadata($optionalArgs['importGcsCustomMetadata']); + } + + if (isset($optionalArgs['smartMessagingPartialUpdate'])) { + $request->setSmartMessagingPartialUpdate($optionalArgs['smartMessagingPartialUpdate']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ReloadDocument', $optionalArgs, $request, $this->getOperationsClient())->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] + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $document = new Document(); + * $operationResponse = $documentsClient->updateDocument($document); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentsClient->updateDocument($document); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'updateDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param Document $document Required. The document to update. + * @param array $optionalArgs { + * Optional. + * + * @type 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. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateDocument($document, array $optionalArgs = []) + { + $request = new UpdateDocumentRequest(); + $requestParamHeaders = []; + $request->setDocument($document); + $requestParamHeaders['document.name'] = $document->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * $response = $documentsClient->getLocation(); + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $documentsClient = new DocumentsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $documentsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php new file mode 100644 index 000000000000..fa66e2802cce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php @@ -0,0 +1,1346 @@ +entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + * $entities = []; + * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchCreateEntities'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\EntityTypesClient} to use the new surface. + */ +class EntityTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.EntityTypes'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $entityTypeNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectEntityTypeNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationEntityTypeNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getEntityTypeNameTemplate() + { + if (self::$entityTypeNameTemplate == null) { + self::$entityTypeNameTemplate = new PathTemplate('projects/{project}/agent/entityTypes/{entity_type}'); + } + + return self::$entityTypeNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectEntityTypeNameTemplate() + { + if (self::$projectEntityTypeNameTemplate == null) { + self::$projectEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/entityTypes/{entity_type}'); + } + + return self::$projectEntityTypeNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getProjectLocationEntityTypeNameTemplate() + { + if (self::$projectLocationEntityTypeNameTemplate == null) { + self::$projectLocationEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/entityTypes/{entity_type}'); + } + + return self::$projectLocationEntityTypeNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'entityType' => self::getEntityTypeNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectEntityType' => self::getProjectEntityTypeNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationEntityType' => self::getProjectLocationEntityTypeNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project, $entityType) + { + return self::getEntityTypeNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $entityType) + { + return self::getProjectEntityTypeNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->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($project, $location, $entityType) + { + return self::getProjectLocationEntityTypeNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * 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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + * $entities = []; + * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchCreateEntities'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the entity type to create entities in. Format: + * `projects//agent/entityTypes/`. + * @param Entity[] $entities Required. The entities to create. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchCreateEntities($parent, $entities, array $optionalArgs = []) + { + $request = new BatchCreateEntitiesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEntities($entities); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchCreateEntities', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + * $entityValues = []; + * $operationResponse = $entityTypesClient->batchDeleteEntities($formattedParent, $entityValues); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $entityTypesClient->batchDeleteEntities($formattedParent, $entityValues); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchDeleteEntities'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the entity type to delete entries for. Format: + * `projects//agent/entityTypes/`. + * @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 array $optionalArgs { + * Optional. + * + * @type 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). + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchDeleteEntities($parent, $entityValues, array $optionalArgs = []) + { + $request = new BatchDeleteEntitiesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEntityValues($entityValues); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchDeleteEntities', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); + * $entityTypeNames = []; + * $operationResponse = $entityTypesClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $entityTypesClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchDeleteEntityTypes'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @param string[] $entityTypeNames Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchDeleteEntityTypes($parent, $entityTypeNames, array $optionalArgs = []) + { + $request = new BatchDeleteEntityTypesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEntityTypeNames($entityTypeNames); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchDeleteEntityTypes', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + * $entities = []; + * $operationResponse = $entityTypesClient->batchUpdateEntities($formattedParent, $entities); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $entityTypesClient->batchUpdateEntities($formattedParent, $entities); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchUpdateEntities'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the entity type to update or create entities in. + * Format: `projects//agent/entityTypes/`. + * @param Entity[] $entities Required. The entities to update or create. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchUpdateEntities($parent, $entities, array $optionalArgs = []) + { + $request = new BatchUpdateEntitiesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEntities($entities); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchUpdateEntities', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); + * $operationResponse = $entityTypesClient->batchUpdateEntityTypes($formattedParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $entityTypesClient->batchUpdateEntityTypes($formattedParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchUpdateEntityTypes'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the agent to update or create entity types in. + * Format: `projects//agent`. + * @param array $optionalArgs { + * Optional. + * + * @type string $entityTypeBatchUri + * 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 EntityTypeBatch $entityTypeBatchInline + * The collection of entity types to update or create. + * @type 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). + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchUpdateEntityTypes($parent, array $optionalArgs = []) + { + $request = new BatchUpdateEntityTypesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['entityTypeBatchUri'])) { + $request->setEntityTypeBatchUri($optionalArgs['entityTypeBatchUri']); + } + + if (isset($optionalArgs['entityTypeBatchInline'])) { + $request->setEntityTypeBatchInline($optionalArgs['entityTypeBatchInline']); + } + + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchUpdateEntityTypes', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); + * $entityType = new EntityType(); + * $response = $entityTypesClient->createEntityType($formattedParent, $entityType); + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to create a entity type for. + * Format: `projects//agent`. + * @param EntityType $entityType Required. The entity type to create. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @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 \Google\Cloud\Dialogflow\V2\EntityType + * + * @throws ApiException if the remote call fails + */ + public function createEntityType($parent, $entityType, array $optionalArgs = []) + { + $request = new CreateEntityTypeRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEntityType($entityType); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateEntityType', EntityType::class, $optionalArgs, $request)->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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedName = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + * $entityTypesClient->deleteEntityType($formattedName); + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteEntityType($name, array $optionalArgs = []) + { + $request = new DeleteEntityTypeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteEntityType', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified entity type. + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedName = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + * $response = $entityTypesClient->getEntityType($formattedName); + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @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 \Google\Cloud\Dialogflow\V2\EntityType + * + * @throws ApiException if the remote call fails + */ + public function getEntityType($name, array $optionalArgs = []) + { + $request = new GetEntityTypeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEntityType', EntityType::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all entity types in the specified agent. + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $entityTypesClient->listEntityTypes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $entityTypesClient->listEntityTypes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to list all entity types from. + * Format: `projects//agent`. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listEntityTypes($parent, array $optionalArgs = []) + { + $request = new ListEntityTypesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEntityTypes', $optionalArgs, ListEntityTypesResponse::class, $request); + } + + /** + * 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). + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $entityType = new EntityType(); + * $response = $entityTypesClient->updateEntityType($entityType); + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param EntityType $entityType Required. The entity type to update. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @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 \Google\Cloud\Dialogflow\V2\EntityType + * + * @throws ApiException if the remote call fails + */ + public function updateEntityType($entityType, array $optionalArgs = []) + { + $request = new UpdateEntityTypeRequest(); + $requestParamHeaders = []; + $request->setEntityType($entityType); + $requestParamHeaders['entity_type.name'] = $entityType->getName(); + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateEntityType', EntityType::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * $response = $entityTypesClient->getLocation(); + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $entityTypesClient = new EntityTypesClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $entityTypesClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $entityTypesClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $entityTypesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php new file mode 100644 index 000000000000..b3593b208ad6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php @@ -0,0 +1,1054 @@ +agentName('[PROJECT]'); + * $environment = new Environment(); + * $environmentId = 'environment_id'; + * $response = $environmentsClient->createEnvironment($formattedParent, $environment, $environmentId); + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\EnvironmentsClient} to use the new surface. + */ +class EnvironmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Environments'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $environmentNameTemplate; + + private static $fulfillmentNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectEnvironmentNameTemplate; + + private static $projectFulfillmentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationEnvironmentNameTemplate; + + private static $projectLocationFulfillmentNameTemplate; + + private static $projectLocationVersionNameTemplate; + + private static $projectVersionNameTemplate; + + private static $versionNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getEnvironmentNameTemplate() + { + if (self::$environmentNameTemplate == null) { + self::$environmentNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}'); + } + + return self::$environmentNameTemplate; + } + + private static function getFulfillmentNameTemplate() + { + if (self::$fulfillmentNameTemplate == null) { + self::$fulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); + } + + return self::$fulfillmentNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectEnvironmentNameTemplate() + { + if (self::$projectEnvironmentNameTemplate == null) { + self::$projectEnvironmentNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}'); + } + + return self::$projectEnvironmentNameTemplate; + } + + private static function getProjectFulfillmentNameTemplate() + { + if (self::$projectFulfillmentNameTemplate == null) { + self::$projectFulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); + } + + return self::$projectFulfillmentNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getProjectLocationEnvironmentNameTemplate() + { + if (self::$projectLocationEnvironmentNameTemplate == null) { + self::$projectLocationEnvironmentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}'); + } + + return self::$projectLocationEnvironmentNameTemplate; + } + + private static function getProjectLocationFulfillmentNameTemplate() + { + if (self::$projectLocationFulfillmentNameTemplate == null) { + self::$projectLocationFulfillmentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/fulfillment'); + } + + return self::$projectLocationFulfillmentNameTemplate; + } + + private static function getProjectLocationVersionNameTemplate() + { + if (self::$projectLocationVersionNameTemplate == null) { + self::$projectLocationVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/versions/{version}'); + } + + return self::$projectLocationVersionNameTemplate; + } + + private static function getProjectVersionNameTemplate() + { + if (self::$projectVersionNameTemplate == null) { + self::$projectVersionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); + } + + return self::$projectVersionNameTemplate; + } + + private static function getVersionNameTemplate() + { + if (self::$versionNameTemplate == null) { + self::$versionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); + } + + return self::$versionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'environment' => self::getEnvironmentNameTemplate(), + 'fulfillment' => self::getFulfillmentNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectEnvironment' => self::getProjectEnvironmentNameTemplate(), + 'projectFulfillment' => self::getProjectFulfillmentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationEnvironment' => self::getProjectLocationEnvironmentNameTemplate(), + 'projectLocationFulfillment' => self::getProjectLocationFulfillmentNameTemplate(), + 'projectLocationVersion' => self::getProjectLocationVersionNameTemplate(), + 'projectVersion' => self::getProjectVersionNameTemplate(), + 'version' => self::getVersionNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project, $environment) + { + return self::getEnvironmentNameTemplate()->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($project) + { + return self::getFulfillmentNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $environment) + { + return self::getProjectEnvironmentNameTemplate()->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($project) + { + return self::getProjectFulfillmentNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->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($project, $location, $environment) + { + return self::getProjectLocationEnvironmentNameTemplate()->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($project, $location) + { + return self::getProjectLocationFulfillmentNameTemplate()->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($project, $location, $version) + { + return self::getProjectLocationVersionNameTemplate()->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($project, $version) + { + return self::getProjectVersionNameTemplate()->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($project, $version) + { + return self::getVersionNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates an agent environment. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $formattedParent = $environmentsClient->agentName('[PROJECT]'); + * $environment = new Environment(); + * $environmentId = 'environment_id'; + * $response = $environmentsClient->createEnvironment($formattedParent, $environment, $environmentId); + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to create an environment for. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param Environment $environment Required. The environment to create. + * @param string $environmentId Required. The unique id of the new environment. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Environment + * + * @throws ApiException if the remote call fails + */ + public function createEnvironment($parent, $environment, $environmentId, array $optionalArgs = []) + { + $request = new CreateEnvironmentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEnvironment($environment); + $request->setEnvironmentId($environmentId); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateEnvironment', Environment::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the specified agent environment. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $formattedName = $environmentsClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + * $environmentsClient->deleteEnvironment($formattedName); + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param 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 `-`. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteEnvironment($name, array $optionalArgs = []) + { + $request = new DeleteEnvironmentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteEnvironment', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified agent environment. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $formattedName = $environmentsClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + * $response = $environmentsClient->getEnvironment($formattedName); + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param 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 `-`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Environment + * + * @throws ApiException if the remote call fails + */ + public function getEnvironment($name, array $optionalArgs = []) + { + $request = new GetEnvironmentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEnvironment', Environment::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the history of the specified environment. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $formattedParent = $environmentsClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); + * // Iterate over pages of elements + * $pagedResponse = $environmentsClient->getEnvironmentHistory($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $environmentsClient->getEnvironmentHistory($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param 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 `-`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function getEnvironmentHistory($parent, array $optionalArgs = []) + { + $request = new GetEnvironmentHistoryRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('GetEnvironmentHistory', $optionalArgs, EnvironmentHistory::class, $request); + } + + /** + * Returns the list of all non-default environments of the specified agent. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $formattedParent = $environmentsClient->agentName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $environmentsClient->listEnvironments($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $environmentsClient->listEnvironments($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to list all environments from. + * Format: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listEnvironments($parent, array $optionalArgs = []) + { + $request = new ListEnvironmentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEnvironments', $optionalArgs, ListEnvironmentsResponse::class, $request); + } + + /** + * 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. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $environment = new Environment(); + * $updateMask = new FieldMask(); + * $response = $environmentsClient->updateEnvironment($environment, $updateMask); + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param Environment $environment Required. The environment to update. + * @param FieldMask $updateMask Required. The mask to control which fields get updated. + * @param array $optionalArgs { + * Optional. + * + * @type bool $allowLoadToDraftAndDiscardChanges + * 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 = `-`). + * @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 \Google\Cloud\Dialogflow\V2\Environment + * + * @throws ApiException if the remote call fails + */ + public function updateEnvironment($environment, $updateMask, array $optionalArgs = []) + { + $request = new UpdateEnvironmentRequest(); + $requestParamHeaders = []; + $request->setEnvironment($environment); + $request->setUpdateMask($updateMask); + $requestParamHeaders['environment.name'] = $environment->getName(); + if (isset($optionalArgs['allowLoadToDraftAndDiscardChanges'])) { + $request->setAllowLoadToDraftAndDiscardChanges($optionalArgs['allowLoadToDraftAndDiscardChanges']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateEnvironment', Environment::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * $response = $environmentsClient->getLocation(); + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $environmentsClient = new EnvironmentsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $environmentsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $environmentsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $environmentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php new file mode 100644 index 000000000000..b0ca0504ae53 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php @@ -0,0 +1,510 @@ +fulfillmentName('[PROJECT]'); + * $response = $fulfillmentsClient->getFulfillment($formattedName); + * } finally { + * $fulfillmentsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\FulfillmentsClient} to use the new surface. + */ +class FulfillmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Fulfillments'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $fulfillmentNameTemplate; + + private static $projectFulfillmentNameTemplate; + + private static $projectLocationFulfillmentNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getFulfillmentNameTemplate() + { + if (self::$fulfillmentNameTemplate == null) { + self::$fulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); + } + + return self::$fulfillmentNameTemplate; + } + + private static function getProjectFulfillmentNameTemplate() + { + if (self::$projectFulfillmentNameTemplate == null) { + self::$projectFulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); + } + + return self::$projectFulfillmentNameTemplate; + } + + private static function getProjectLocationFulfillmentNameTemplate() + { + if (self::$projectLocationFulfillmentNameTemplate == null) { + self::$projectLocationFulfillmentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/fulfillment'); + } + + return self::$projectLocationFulfillmentNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'fulfillment' => self::getFulfillmentNameTemplate(), + 'projectFulfillment' => self::getProjectFulfillmentNameTemplate(), + 'projectLocationFulfillment' => self::getProjectLocationFulfillmentNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getFulfillmentNameTemplate()->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($project) + { + return self::getProjectFulfillmentNameTemplate()->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($project, $location) + { + return self::getProjectLocationFulfillmentNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Retrieves the fulfillment. + * + * Sample code: + * ``` + * $fulfillmentsClient = new FulfillmentsClient(); + * try { + * $formattedName = $fulfillmentsClient->fulfillmentName('[PROJECT]'); + * $response = $fulfillmentsClient->getFulfillment($formattedName); + * } finally { + * $fulfillmentsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Fulfillment + * + * @throws ApiException if the remote call fails + */ + public function getFulfillment($name, array $optionalArgs = []) + { + $request = new GetFulfillmentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetFulfillment', Fulfillment::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the fulfillment. + * + * Sample code: + * ``` + * $fulfillmentsClient = new FulfillmentsClient(); + * try { + * $fulfillment = new Fulfillment(); + * $updateMask = new FieldMask(); + * $response = $fulfillmentsClient->updateFulfillment($fulfillment, $updateMask); + * } finally { + * $fulfillmentsClient->close(); + * } + * ``` + * + * @param Fulfillment $fulfillment Required. The fulfillment to update. + * @param FieldMask $updateMask Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Fulfillment + * + * @throws ApiException if the remote call fails + */ + public function updateFulfillment($fulfillment, $updateMask, array $optionalArgs = []) + { + $request = new UpdateFulfillmentRequest(); + $requestParamHeaders = []; + $request->setFulfillment($fulfillment); + $request->setUpdateMask($updateMask); + $requestParamHeaders['fulfillment.name'] = $fulfillment->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateFulfillment', Fulfillment::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $fulfillmentsClient = new FulfillmentsClient(); + * try { + * $response = $fulfillmentsClient->getLocation(); + * } finally { + * $fulfillmentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $fulfillmentsClient = new FulfillmentsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $fulfillmentsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $fulfillmentsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $fulfillmentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php new file mode 100644 index 000000000000..8604b2960ec9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php @@ -0,0 +1,1441 @@ +agentName('[PROJECT]'); + * $intents = []; + * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $intentsClient->resumeOperation($operationName, 'batchDeleteIntents'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\IntentsClient} to use the new surface. + */ +class IntentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Intents'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $contextNameTemplate; + + private static $intentNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectEnvironmentUserSessionNameTemplate; + + private static $projectEnvironmentUserSessionContextNameTemplate; + + private static $projectIntentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationEnvironmentUserSessionNameTemplate; + + private static $projectLocationEnvironmentUserSessionContextNameTemplate; + + private static $projectLocationIntentNameTemplate; + + private static $projectLocationSessionNameTemplate; + + private static $projectLocationSessionContextNameTemplate; + + private static $projectSessionNameTemplate; + + private static $projectSessionContextNameTemplate; + + private static $sessionNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getContextNameTemplate() + { + if (self::$contextNameTemplate == null) { + self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$contextNameTemplate; + } + + private static function getIntentNameTemplate() + { + if (self::$intentNameTemplate == null) { + self::$intentNameTemplate = new PathTemplate('projects/{project}/agent/intents/{intent}'); + } + + return self::$intentNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectEnvironmentUserSessionNameTemplate() + { + if (self::$projectEnvironmentUserSessionNameTemplate == null) { + self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectEnvironmentUserSessionNameTemplate; + } + + private static function getProjectEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { + self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectIntentNameTemplate() + { + if (self::$projectIntentNameTemplate == null) { + self::$projectIntentNameTemplate = new PathTemplate('projects/{project}/agent/intents/{intent}'); + } + + return self::$projectIntentNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectLocationEnvironmentUserSessionNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectLocationIntentNameTemplate() + { + if (self::$projectLocationIntentNameTemplate == null) { + self::$projectLocationIntentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/intents/{intent}'); + } + + return self::$projectLocationIntentNameTemplate; + } + + private static function getProjectLocationSessionNameTemplate() + { + if (self::$projectLocationSessionNameTemplate == null) { + self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); + } + + return self::$projectLocationSessionNameTemplate; + } + + private static function getProjectLocationSessionContextNameTemplate() + { + if (self::$projectLocationSessionContextNameTemplate == null) { + self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationSessionContextNameTemplate; + } + + private static function getProjectSessionNameTemplate() + { + if (self::$projectSessionNameTemplate == null) { + self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$projectSessionNameTemplate; + } + + private static function getProjectSessionContextNameTemplate() + { + if (self::$projectSessionContextNameTemplate == null) { + self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectSessionContextNameTemplate; + } + + private static function getSessionNameTemplate() + { + if (self::$sessionNameTemplate == null) { + self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$sessionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'context' => self::getContextNameTemplate(), + 'intent' => self::getIntentNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), + 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), + 'projectIntent' => self::getProjectIntentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), + 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), + 'projectLocationIntent' => self::getProjectLocationIntentNameTemplate(), + 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), + 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), + 'projectSession' => self::getProjectSessionNameTemplate(), + 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), + 'session' => self::getSessionNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project, $session, $context) + { + return self::getContextNameTemplate()->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($project, $intent) + { + return self::getIntentNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $environment, $user, $session) + { + return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) + { + return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $intent) + { + return self::getProjectIntentNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->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($project, $location, $environment, $user, $session) + { + return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) + { + return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $intent) + { + return self::getProjectLocationIntentNameTemplate()->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($project, $location, $session) + { + return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) + { + return self::getProjectLocationSessionContextNameTemplate()->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($project, $session) + { + return self::getProjectSessionNameTemplate()->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($project, $session, $context) + { + return self::getProjectSessionContextNameTemplate()->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($project, $session) + { + return self::getSessionNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * 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). + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $formattedParent = $intentsClient->agentName('[PROJECT]'); + * $intents = []; + * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $intentsClient->resumeOperation($operationName, 'batchDeleteIntents'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @param Intent[] $intents Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * @param array $optionalArgs { + * 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchDeleteIntents($parent, $intents, array $optionalArgs = []) + { + $request = new BatchDeleteIntentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setIntents($intents); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchDeleteIntents', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $formattedParent = $intentsClient->agentName('[PROJECT]'); + * $operationResponse = $intentsClient->batchUpdateIntents($formattedParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $intentsClient->batchUpdateIntents($formattedParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $intentsClient->resumeOperation($operationName, 'batchUpdateIntents'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the agent to update or create intents in. + * Format: `projects//agent`. + * @param array $optionalArgs { + * Optional. + * + * @type 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://". + * @type IntentBatch $intentBatchInline + * The collection of intents to update or create. + * @type 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). + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @type int $intentView + * Optional. The resource view to apply to the returned intent. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchUpdateIntents($parent, array $optionalArgs = []) + { + $request = new BatchUpdateIntentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['intentBatchUri'])) { + $request->setIntentBatchUri($optionalArgs['intentBatchUri']); + } + + if (isset($optionalArgs['intentBatchInline'])) { + $request->setIntentBatchInline($optionalArgs['intentBatchInline']); + } + + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['intentView'])) { + $request->setIntentView($optionalArgs['intentView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchUpdateIntents', $optionalArgs, $request, $this->getOperationsClient())->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). + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $formattedParent = $intentsClient->agentName('[PROJECT]'); + * $intent = new Intent(); + * $response = $intentsClient->createIntent($formattedParent, $intent); + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to create a intent for. + * Format: `projects//agent`. + * @param Intent $intent Required. The intent to create. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type int $intentView + * Optional. The resource view to apply to the returned intent. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} + * @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 \Google\Cloud\Dialogflow\V2\Intent + * + * @throws ApiException if the remote call fails + */ + public function createIntent($parent, $intent, array $optionalArgs = []) + { + $request = new CreateIntentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setIntent($intent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['intentView'])) { + $request->setIntentView($optionalArgs['intentView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateIntent', Intent::class, $optionalArgs, $request)->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). + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $formattedName = $intentsClient->intentName('[PROJECT]', '[INTENT]'); + * $intentsClient->deleteIntent($formattedName); + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @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/`. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteIntent($name, array $optionalArgs = []) + { + $request = new DeleteIntentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteIntent', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified intent. + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $formattedName = $intentsClient->intentName('[PROJECT]', '[INTENT]'); + * $response = $intentsClient->getIntent($formattedName); + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the intent. + * Format: `projects//agent/intents/`. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type int $intentView + * Optional. The resource view to apply to the returned intent. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} + * @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 \Google\Cloud\Dialogflow\V2\Intent + * + * @throws ApiException if the remote call fails + */ + public function getIntent($name, array $optionalArgs = []) + { + $request = new GetIntentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['intentView'])) { + $request->setIntentView($optionalArgs['intentView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIntent', Intent::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all intents in the specified agent. + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $formattedParent = $intentsClient->agentName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $intentsClient->listIntents($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $intentsClient->listIntents($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type int $intentView + * Optional. The resource view to apply to the returned intent. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listIntents($parent, array $optionalArgs = []) + { + $request = new ListIntentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['intentView'])) { + $request->setIntentView($optionalArgs['intentView']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListIntents', $optionalArgs, ListIntentsResponse::class, $request); + } + + /** + * 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). + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $intent = new Intent(); + * $response = $intentsClient->updateIntent($intent); + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param Intent $intent Required. The intent to update. + * @param array $optionalArgs { + * Optional. + * + * @type 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). + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @type int $intentView + * Optional. The resource view to apply to the returned intent. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} + * @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 \Google\Cloud\Dialogflow\V2\Intent + * + * @throws ApiException if the remote call fails + */ + public function updateIntent($intent, array $optionalArgs = []) + { + $request = new UpdateIntentRequest(); + $requestParamHeaders = []; + $request->setIntent($intent); + $requestParamHeaders['intent.name'] = $intent->getName(); + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['intentView'])) { + $request->setIntentView($optionalArgs['intentView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateIntent', Intent::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * $response = $intentsClient->getLocation(); + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $intentsClient = new IntentsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $intentsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $intentsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $intentsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php new file mode 100644 index 000000000000..699e847ebefa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php @@ -0,0 +1,775 @@ +projectName('[PROJECT]'); + * $knowledgeBase = new KnowledgeBase(); + * $response = $knowledgeBasesClient->createKnowledgeBase($formattedParent, $knowledgeBase); + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\KnowledgeBasesClient} to use the new surface. + */ +class KnowledgeBasesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.KnowledgeBases'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $knowledgeBaseNameTemplate; + + private static $locationNameTemplate; + + private static $projectNameTemplate; + + private static $projectKnowledgeBaseNameTemplate; + + private static $projectLocationKnowledgeBaseNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getKnowledgeBaseNameTemplate() + { + if (self::$knowledgeBaseNameTemplate == null) { + self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$knowledgeBaseNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectKnowledgeBaseNameTemplate() + { + if (self::$projectKnowledgeBaseNameTemplate == null) { + self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectKnowledgeBaseNameTemplate; + } + + private static function getProjectLocationKnowledgeBaseNameTemplate() + { + if (self::$projectLocationKnowledgeBaseNameTemplate == null) { + self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); + } + + return self::$projectLocationKnowledgeBaseNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), + 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $knowledgeBase) + { + return self::getKnowledgeBaseNameTemplate()->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($project, $location) + { + return self::getLocationNameTemplate()->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($project) + { + return self::getProjectNameTemplate()->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($project, $knowledgeBase) + { + return self::getProjectKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase) + { + return self::getProjectLocationKnowledgeBaseNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a knowledge base. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * $formattedParent = $knowledgeBasesClient->projectName('[PROJECT]'); + * $knowledgeBase = new KnowledgeBase(); + * $response = $knowledgeBasesClient->createKnowledgeBase($formattedParent, $knowledgeBase); + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * @param KnowledgeBase $knowledgeBase Required. The knowledge base to create. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\KnowledgeBase + * + * @throws ApiException if the remote call fails + */ + public function createKnowledgeBase($parent, $knowledgeBase, array $optionalArgs = []) + { + $request = new CreateKnowledgeBaseRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setKnowledgeBase($knowledgeBase); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateKnowledgeBase', KnowledgeBase::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the specified knowledge base. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * $formattedName = $knowledgeBasesClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + * $knowledgeBasesClient->deleteKnowledgeBase($formattedName); + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * @param array $optionalArgs { + * Optional. + * + * @type bool $force + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * @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 if the remote call fails + */ + public function deleteKnowledgeBase($name, array $optionalArgs = []) + { + $request = new DeleteKnowledgeBaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteKnowledgeBase', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified knowledge base. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * $formattedName = $knowledgeBasesClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + * $response = $knowledgeBasesClient->getKnowledgeBase($formattedName); + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\KnowledgeBase + * + * @throws ApiException if the remote call fails + */ + public function getKnowledgeBase($name, array $optionalArgs = []) + { + $request = new GetKnowledgeBaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetKnowledgeBase', KnowledgeBase::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all knowledge bases of the specified agent. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * $formattedParent = $knowledgeBasesClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $knowledgeBasesClient->listKnowledgeBases($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $knowledgeBasesClient->listKnowledgeBases($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param string $parent Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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). + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listKnowledgeBases($parent, array $optionalArgs = []) + { + $request = new ListKnowledgeBasesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListKnowledgeBases', $optionalArgs, ListKnowledgeBasesResponse::class, $request); + } + + /** + * Updates the specified knowledge base. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * $knowledgeBase = new KnowledgeBase(); + * $response = $knowledgeBasesClient->updateKnowledgeBase($knowledgeBase); + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param KnowledgeBase $knowledgeBase Required. The knowledge base to update. + * @param array $optionalArgs { + * Optional. + * + * @type 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. + * @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 \Google\Cloud\Dialogflow\V2\KnowledgeBase + * + * @throws ApiException if the remote call fails + */ + public function updateKnowledgeBase($knowledgeBase, array $optionalArgs = []) + { + $request = new UpdateKnowledgeBaseRequest(); + $requestParamHeaders = []; + $request->setKnowledgeBase($knowledgeBase); + $requestParamHeaders['knowledge_base.name'] = $knowledgeBase->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateKnowledgeBase', KnowledgeBase::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * $response = $knowledgeBasesClient->getLocation(); + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $knowledgeBasesClient = new KnowledgeBasesClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $knowledgeBasesClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $knowledgeBasesClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $knowledgeBasesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php new file mode 100644 index 000000000000..53f5a849a6c0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php @@ -0,0 +1,1726 @@ +participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->analyzeContent($formattedParticipant); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\ParticipantsClient} to use the new surface. + */ +class ParticipantsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Participants'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $contextNameTemplate; + + private static $conversationNameTemplate; + + private static $messageNameTemplate; + + private static $participantNameTemplate; + + private static $projectConversationNameTemplate; + + private static $projectConversationMessageNameTemplate; + + private static $projectConversationParticipantNameTemplate; + + private static $projectEnvironmentUserSessionNameTemplate; + + private static $projectEnvironmentUserSessionContextNameTemplate; + + private static $projectEnvironmentUserSessionEntityTypeNameTemplate; + + private static $projectLocationConversationNameTemplate; + + private static $projectLocationConversationMessageNameTemplate; + + private static $projectLocationConversationParticipantNameTemplate; + + private static $projectLocationEnvironmentUserSessionNameTemplate; + + private static $projectLocationEnvironmentUserSessionContextNameTemplate; + + private static $projectLocationEnvironmentUserSessionEntityTypeNameTemplate; + + private static $projectLocationSessionNameTemplate; + + private static $projectLocationSessionContextNameTemplate; + + private static $projectLocationSessionEntityTypeNameTemplate; + + private static $projectSessionNameTemplate; + + private static $projectSessionContextNameTemplate; + + private static $projectSessionEntityTypeNameTemplate; + + private static $sessionNameTemplate; + + private static $sessionEntityTypeNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getContextNameTemplate() + { + if (self::$contextNameTemplate == null) { + self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$contextNameTemplate; + } + + private static function getConversationNameTemplate() + { + if (self::$conversationNameTemplate == null) { + self::$conversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); + } + + return self::$conversationNameTemplate; + } + + private static function getMessageNameTemplate() + { + if (self::$messageNameTemplate == null) { + self::$messageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); + } + + return self::$messageNameTemplate; + } + + private static function getParticipantNameTemplate() + { + if (self::$participantNameTemplate == null) { + self::$participantNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/participants/{participant}'); + } + + return self::$participantNameTemplate; + } + + private static function getProjectConversationNameTemplate() + { + if (self::$projectConversationNameTemplate == null) { + self::$projectConversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); + } + + return self::$projectConversationNameTemplate; + } + + private static function getProjectConversationMessageNameTemplate() + { + if (self::$projectConversationMessageNameTemplate == null) { + self::$projectConversationMessageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); + } + + return self::$projectConversationMessageNameTemplate; + } + + private static function getProjectConversationParticipantNameTemplate() + { + if (self::$projectConversationParticipantNameTemplate == null) { + self::$projectConversationParticipantNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/participants/{participant}'); + } + + return self::$projectConversationParticipantNameTemplate; + } + + private static function getProjectEnvironmentUserSessionNameTemplate() + { + if (self::$projectEnvironmentUserSessionNameTemplate == null) { + self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectEnvironmentUserSessionNameTemplate; + } + + private static function getProjectEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { + self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectEnvironmentUserSessionEntityTypeNameTemplate() + { + if (self::$projectEnvironmentUserSessionEntityTypeNameTemplate == null) { + self::$projectEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectEnvironmentUserSessionEntityTypeNameTemplate; + } + + private static function getProjectLocationConversationNameTemplate() + { + if (self::$projectLocationConversationNameTemplate == null) { + self::$projectLocationConversationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}'); + } + + return self::$projectLocationConversationNameTemplate; + } + + private static function getProjectLocationConversationMessageNameTemplate() + { + if (self::$projectLocationConversationMessageNameTemplate == null) { + self::$projectLocationConversationMessageNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}'); + } + + return self::$projectLocationConversationMessageNameTemplate; + } + + private static function getProjectLocationConversationParticipantNameTemplate() + { + if (self::$projectLocationConversationParticipantNameTemplate == null) { + self::$projectLocationConversationParticipantNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}'); + } + + return self::$projectLocationConversationParticipantNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectLocationEnvironmentUserSessionNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate; + } + + private static function getProjectLocationSessionNameTemplate() + { + if (self::$projectLocationSessionNameTemplate == null) { + self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); + } + + return self::$projectLocationSessionNameTemplate; + } + + private static function getProjectLocationSessionContextNameTemplate() + { + if (self::$projectLocationSessionContextNameTemplate == null) { + self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationSessionContextNameTemplate; + } + + private static function getProjectLocationSessionEntityTypeNameTemplate() + { + if (self::$projectLocationSessionEntityTypeNameTemplate == null) { + self::$projectLocationSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectLocationSessionEntityTypeNameTemplate; + } + + private static function getProjectSessionNameTemplate() + { + if (self::$projectSessionNameTemplate == null) { + self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$projectSessionNameTemplate; + } + + private static function getProjectSessionContextNameTemplate() + { + if (self::$projectSessionContextNameTemplate == null) { + self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectSessionContextNameTemplate; + } + + private static function getProjectSessionEntityTypeNameTemplate() + { + if (self::$projectSessionEntityTypeNameTemplate == null) { + self::$projectSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectSessionEntityTypeNameTemplate; + } + + private static function getSessionNameTemplate() + { + if (self::$sessionNameTemplate == null) { + self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$sessionNameTemplate; + } + + private static function getSessionEntityTypeNameTemplate() + { + if (self::$sessionEntityTypeNameTemplate == null) { + self::$sessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$sessionEntityTypeNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'context' => self::getContextNameTemplate(), + 'conversation' => self::getConversationNameTemplate(), + 'message' => self::getMessageNameTemplate(), + 'participant' => self::getParticipantNameTemplate(), + 'projectConversation' => self::getProjectConversationNameTemplate(), + 'projectConversationMessage' => self::getProjectConversationMessageNameTemplate(), + 'projectConversationParticipant' => self::getProjectConversationParticipantNameTemplate(), + 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), + 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), + 'projectEnvironmentUserSessionEntityType' => self::getProjectEnvironmentUserSessionEntityTypeNameTemplate(), + 'projectLocationConversation' => self::getProjectLocationConversationNameTemplate(), + 'projectLocationConversationMessage' => self::getProjectLocationConversationMessageNameTemplate(), + 'projectLocationConversationParticipant' => self::getProjectLocationConversationParticipantNameTemplate(), + 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), + 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), + 'projectLocationEnvironmentUserSessionEntityType' => self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate(), + 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), + 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), + 'projectLocationSessionEntityType' => self::getProjectLocationSessionEntityTypeNameTemplate(), + 'projectSession' => self::getProjectSessionNameTemplate(), + 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), + 'projectSessionEntityType' => self::getProjectSessionEntityTypeNameTemplate(), + 'session' => self::getSessionNameTemplate(), + 'sessionEntityType' => self::getSessionEntityTypeNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $session, $context) + { + return self::getContextNameTemplate()->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($project, $conversation) + { + return self::getConversationNameTemplate()->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($project, $conversation, $message) + { + return self::getMessageNameTemplate()->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($project, $conversation, $participant) + { + return self::getParticipantNameTemplate()->render([ + 'project' => $project, + 'conversation' => $conversation, + 'participant' => $participant, + ]); + } + + /** + * 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($project, $conversation) + { + return self::getProjectConversationNameTemplate()->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($project, $conversation, $message) + { + return self::getProjectConversationMessageNameTemplate()->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($project, $conversation, $participant) + { + return self::getProjectConversationParticipantNameTemplate()->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($project, $environment, $user, $session) + { + return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) + { + return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $environment, $user, $session, $entityType) + { + return self::getProjectEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $conversation) + { + return self::getProjectLocationConversationNameTemplate()->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($project, $location, $conversation, $message) + { + return self::getProjectLocationConversationMessageNameTemplate()->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($project, $location, $conversation, $participant) + { + return self::getProjectLocationConversationParticipantNameTemplate()->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($project, $location, $environment, $user, $session) + { + return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) + { + return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $environment, $user, $session, $entityType) + { + return self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $session) + { + return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) + { + return self::getProjectLocationSessionContextNameTemplate()->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($project, $location, $session, $entityType) + { + return self::getProjectLocationSessionEntityTypeNameTemplate()->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($project, $session) + { + return self::getProjectSessionNameTemplate()->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($project, $session, $context) + { + return self::getProjectSessionContextNameTemplate()->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($project, $session, $entityType) + { + return self::getProjectSessionEntityTypeNameTemplate()->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($project, $session) + { + return self::getSessionNameTemplate()->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($project, $session, $entityType) + { + return self::getSessionEntityTypeNameTemplate()->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} + * - 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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * 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). + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParticipant = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->analyzeContent($formattedParticipant); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $participant Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @param array $optionalArgs { + * Optional. + * + * @type TextInput $textInput + * The natural language text to be processed. + * @type EventInput $eventInput + * An input event to send to Dialogflow. + * @type OutputAudioConfig $replyAudioConfig + * 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 QueryParameters $queryParams + * Parameters for a Dialogflow virtual-agent query. + * @type AssistQueryParameters $assistQueryParams + * Parameters for a human assist query. + * @type Struct $cxParameters + * 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 $requestId + * 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. + * @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 \Google\Cloud\Dialogflow\V2\AnalyzeContentResponse + * + * @throws ApiException if the remote call fails + */ + public function analyzeContent($participant, array $optionalArgs = []) + { + $request = new AnalyzeContentRequest(); + $requestParamHeaders = []; + $request->setParticipant($participant); + $requestParamHeaders['participant'] = $participant; + if (isset($optionalArgs['textInput'])) { + $request->setTextInput($optionalArgs['textInput']); + } + + if (isset($optionalArgs['eventInput'])) { + $request->setEventInput($optionalArgs['eventInput']); + } + + if (isset($optionalArgs['replyAudioConfig'])) { + $request->setReplyAudioConfig($optionalArgs['replyAudioConfig']); + } + + if (isset($optionalArgs['queryParams'])) { + $request->setQueryParams($optionalArgs['queryParams']); + } + + if (isset($optionalArgs['assistQueryParams'])) { + $request->setAssistQueryParams($optionalArgs['assistQueryParams']); + } + + if (isset($optionalArgs['cxParameters'])) { + $request->setCxParameters($optionalArgs['cxParameters']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AnalyzeContent', AnalyzeContentResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new participant in a conversation. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParent = $participantsClient->conversationName('[PROJECT]', '[CONVERSATION]'); + * $participant = new Participant(); + * $response = $participantsClient->createParticipant($formattedParent, $participant); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @param Participant $participant Required. The participant to create. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Participant + * + * @throws ApiException if the remote call fails + */ + public function createParticipant($parent, $participant, array $optionalArgs = []) + { + $request = new CreateParticipantRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setParticipant($participant); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateParticipant', Participant::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a conversation participant. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedName = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->getParticipant($formattedName); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Participant + * + * @throws ApiException if the remote call fails + */ + public function getParticipant($name, array $optionalArgs = []) + { + $request = new GetParticipantRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetParticipant', Participant::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all participants in the specified conversation. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParent = $participantsClient->conversationName('[PROJECT]', '[CONVERSATION]'); + * // Iterate over pages of elements + * $pagedResponse = $participantsClient->listParticipants($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $participantsClient->listParticipants($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $parent Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listParticipants($parent, array $optionalArgs = []) + { + $request = new ListParticipantsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListParticipants', $optionalArgs, ListParticipantsResponse::class, $request); + } + + /** + * 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). + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $participant = 'participant'; + * $request = new StreamingAnalyzeContentRequest(); + * $request->setParticipant($participant); + * // Write all requests to the server, then read all responses until the + * // stream is complete + * $requests = [ + * $request, + * ]; + * $stream = $participantsClient->streamingAnalyzeContent(); + * $stream->writeAll($requests); + * foreach ($stream->closeWriteAndReadAll() as $element) { + * // doSomethingWith($element); + * } + * // Alternatively: + * // Write requests individually, making read() calls if + * // required. Call closeWrite() once writes are complete, and read the + * // remaining responses from the server. + * $requests = [ + * $request, + * ]; + * $stream = $participantsClient->streamingAnalyzeContent(); + * foreach ($requests as $request) { + * $stream->write($request); + * // if required, read a single response from the stream + * $element = $stream->read(); + * // doSomethingWith($element) + * } + * $stream->closeWrite(); + * $element = $stream->read(); + * while (!is_null($element)) { + * // doSomethingWith($element) + * $element = $stream->read(); + * } + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\BidiStream + * + * @throws ApiException if the remote call fails + */ + public function streamingAnalyzeContent(array $optionalArgs = []) + { + return $this->startCall('StreamingAnalyzeContent', StreamingAnalyzeContentResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); + } + + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->suggestArticles($formattedParent); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $latestMessage + * 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 $contextSize + * 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 AssistQueryParameters $assistQueryParams + * Parameters for a human assist query. + * @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 \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse + * + * @throws ApiException if the remote call fails + */ + public function suggestArticles($parent, array $optionalArgs = []) + { + $request = new SuggestArticlesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['latestMessage'])) { + $request->setLatestMessage($optionalArgs['latestMessage']); + } + + if (isset($optionalArgs['contextSize'])) { + $request->setContextSize($optionalArgs['contextSize']); + } + + if (isset($optionalArgs['assistQueryParams'])) { + $request->setAssistQueryParams($optionalArgs['assistQueryParams']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SuggestArticles', SuggestArticlesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->suggestFaqAnswers($formattedParent); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $latestMessage + * 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 $contextSize + * 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 AssistQueryParameters $assistQueryParams + * Parameters for a human assist query. + * @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 \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse + * + * @throws ApiException if the remote call fails + */ + public function suggestFaqAnswers($parent, array $optionalArgs = []) + { + $request = new SuggestFaqAnswersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['latestMessage'])) { + $request->setLatestMessage($optionalArgs['latestMessage']); + } + + if (isset($optionalArgs['contextSize'])) { + $request->setContextSize($optionalArgs['contextSize']); + } + + if (isset($optionalArgs['assistQueryParams'])) { + $request->setAssistQueryParams($optionalArgs['assistQueryParams']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SuggestFaqAnswers', SuggestFaqAnswersResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets smart replies for a participant based on specific historical + * messages. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->suggestSmartReplies($formattedParent); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param array $optionalArgs { + * Optional. + * + * @type TextInput $currentTextInput + * 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 $latestMessage + * 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 $contextSize + * 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 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 \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse + * + * @throws ApiException if the remote call fails + */ + public function suggestSmartReplies($parent, array $optionalArgs = []) + { + $request = new SuggestSmartRepliesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['currentTextInput'])) { + $request->setCurrentTextInput($optionalArgs['currentTextInput']); + } + + if (isset($optionalArgs['latestMessage'])) { + $request->setLatestMessage($optionalArgs['latestMessage']); + } + + if (isset($optionalArgs['contextSize'])) { + $request->setContextSize($optionalArgs['contextSize']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SuggestSmartReplies', SuggestSmartRepliesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the specified participant. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $participant = new Participant(); + * $updateMask = new FieldMask(); + * $response = $participantsClient->updateParticipant($participant, $updateMask); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param Participant $participant Required. The participant to update. + * @param FieldMask $updateMask Required. The mask to specify which fields to update. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Participant + * + * @throws ApiException if the remote call fails + */ + public function updateParticipant($participant, $updateMask, array $optionalArgs = []) + { + $request = new UpdateParticipantRequest(); + $requestParamHeaders = []; + $request->setParticipant($participant); + $request->setUpdateMask($updateMask); + $requestParamHeaders['participant.name'] = $participant->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateParticipant', Participant::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $response = $participantsClient->getLocation(); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $participantsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $participantsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php new file mode 100644 index 000000000000..71861d909604 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php @@ -0,0 +1,959 @@ +sessionName('[PROJECT]', '[SESSION]'); + * $sessionEntityType = new SessionEntityType(); + * $response = $sessionEntityTypesClient->createSessionEntityType($formattedParent, $sessionEntityType); + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\SessionEntityTypesClient} to use the new + * surface. + */ +class SessionEntityTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $projectEnvironmentUserSessionNameTemplate; + + private static $projectEnvironmentUserSessionEntityTypeNameTemplate; + + private static $projectLocationEnvironmentUserSessionNameTemplate; + + private static $projectLocationEnvironmentUserSessionEntityTypeNameTemplate; + + private static $projectLocationSessionNameTemplate; + + private static $projectLocationSessionEntityTypeNameTemplate; + + private static $projectSessionNameTemplate; + + private static $projectSessionEntityTypeNameTemplate; + + private static $sessionNameTemplate; + + private static $sessionEntityTypeNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getProjectEnvironmentUserSessionNameTemplate() + { + if (self::$projectEnvironmentUserSessionNameTemplate == null) { + self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectEnvironmentUserSessionNameTemplate; + } + + private static function getProjectEnvironmentUserSessionEntityTypeNameTemplate() + { + if (self::$projectEnvironmentUserSessionEntityTypeNameTemplate == null) { + self::$projectEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectEnvironmentUserSessionEntityTypeNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectLocationEnvironmentUserSessionNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate; + } + + private static function getProjectLocationSessionNameTemplate() + { + if (self::$projectLocationSessionNameTemplate == null) { + self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); + } + + return self::$projectLocationSessionNameTemplate; + } + + private static function getProjectLocationSessionEntityTypeNameTemplate() + { + if (self::$projectLocationSessionEntityTypeNameTemplate == null) { + self::$projectLocationSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectLocationSessionEntityTypeNameTemplate; + } + + private static function getProjectSessionNameTemplate() + { + if (self::$projectSessionNameTemplate == null) { + self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$projectSessionNameTemplate; + } + + private static function getProjectSessionEntityTypeNameTemplate() + { + if (self::$projectSessionEntityTypeNameTemplate == null) { + self::$projectSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectSessionEntityTypeNameTemplate; + } + + private static function getSessionNameTemplate() + { + if (self::$sessionNameTemplate == null) { + self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$sessionNameTemplate; + } + + private static function getSessionEntityTypeNameTemplate() + { + if (self::$sessionEntityTypeNameTemplate == null) { + self::$sessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$sessionEntityTypeNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), + 'projectEnvironmentUserSessionEntityType' => self::getProjectEnvironmentUserSessionEntityTypeNameTemplate(), + 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), + 'projectLocationEnvironmentUserSessionEntityType' => self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate(), + 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), + 'projectLocationSessionEntityType' => self::getProjectLocationSessionEntityTypeNameTemplate(), + 'projectSession' => self::getProjectSessionNameTemplate(), + 'projectSessionEntityType' => self::getProjectSessionEntityTypeNameTemplate(), + 'session' => self::getSessionNameTemplate(), + 'sessionEntityType' => self::getSessionEntityTypeNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $environment, $user, $session) + { + return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $entityType) + { + return self::getProjectEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $environment, $user, $session) + { + return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $entityType) + { + return self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $session) + { + return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $entityType) + { + return self::getProjectLocationSessionEntityTypeNameTemplate()->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($project, $session) + { + return self::getProjectSessionNameTemplate()->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($project, $session, $entityType) + { + return self::getProjectSessionEntityTypeNameTemplate()->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($project, $session) + { + return self::getSessionNameTemplate()->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($project, $session, $entityType) + { + return self::getSessionEntityTypeNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * 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. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * $formattedParent = $sessionEntityTypesClient->sessionName('[PROJECT]', '[SESSION]'); + * $sessionEntityType = new SessionEntityType(); + * $response = $sessionEntityTypesClient->createSessionEntityType($formattedParent, $sessionEntityType); + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @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. + * @param SessionEntityType $sessionEntityType Required. The session entity type to create. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\SessionEntityType + * + * @throws ApiException if the remote call fails + */ + public function createSessionEntityType($parent, $sessionEntityType, array $optionalArgs = []) + { + $request = new CreateSessionEntityTypeRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setSessionEntityType($sessionEntityType); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateSessionEntityType', SessionEntityType::class, $optionalArgs, $request)->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. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * $formattedName = $sessionEntityTypesClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); + * $sessionEntityTypesClient->deleteSessionEntityType($formattedName); + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteSessionEntityType($name, array $optionalArgs = []) + { + $request = new DeleteSessionEntityTypeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteSessionEntityType', GPBEmpty::class, $optionalArgs, $request)->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. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * $formattedName = $sessionEntityTypesClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); + * $response = $sessionEntityTypesClient->getSessionEntityType($formattedName); + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\SessionEntityType + * + * @throws ApiException if the remote call fails + */ + public function getSessionEntityType($name, array $optionalArgs = []) + { + $request = new GetSessionEntityTypeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetSessionEntityType', SessionEntityType::class, $optionalArgs, $request)->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. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * $formattedParent = $sessionEntityTypesClient->sessionName('[PROJECT]', '[SESSION]'); + * // Iterate over pages of elements + * $pagedResponse = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @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. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listSessionEntityTypes($parent, array $optionalArgs = []) + { + $request = new ListSessionEntityTypesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListSessionEntityTypes', $optionalArgs, ListSessionEntityTypesResponse::class, $request); + } + + /** + * 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. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * $sessionEntityType = new SessionEntityType(); + * $response = $sessionEntityTypesClient->updateSessionEntityType($sessionEntityType); + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @param SessionEntityType $sessionEntityType Required. The session entity type to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. The mask to control which fields get updated. + * @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 \Google\Cloud\Dialogflow\V2\SessionEntityType + * + * @throws ApiException if the remote call fails + */ + public function updateSessionEntityType($sessionEntityType, array $optionalArgs = []) + { + $request = new UpdateSessionEntityTypeRequest(); + $requestParamHeaders = []; + $request->setSessionEntityType($sessionEntityType); + $requestParamHeaders['session_entity_type.name'] = $sessionEntityType->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateSessionEntityType', SessionEntityType::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * $response = $sessionEntityTypesClient->getLocation(); + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $sessionEntityTypesClient = new SessionEntityTypesClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $sessionEntityTypesClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sessionEntityTypesClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sessionEntityTypesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php new file mode 100644 index 000000000000..a511bb40a939 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php @@ -0,0 +1,1045 @@ +sessionName('[PROJECT]', '[SESSION]'); + * $queryInput = new QueryInput(); + * $response = $sessionsClient->detectIntent($formattedSession, $queryInput); + * } finally { + * $sessionsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\SessionsClient} to use the new surface. + */ +class SessionsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Sessions'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $contextNameTemplate; + + private static $projectEnvironmentUserSessionNameTemplate; + + private static $projectEnvironmentUserSessionContextNameTemplate; + + private static $projectEnvironmentUserSessionEntityTypeNameTemplate; + + private static $projectLocationEnvironmentUserSessionNameTemplate; + + private static $projectLocationEnvironmentUserSessionContextNameTemplate; + + private static $projectLocationEnvironmentUserSessionEntityTypeNameTemplate; + + private static $projectLocationSessionNameTemplate; + + private static $projectLocationSessionContextNameTemplate; + + private static $projectLocationSessionEntityTypeNameTemplate; + + private static $projectSessionNameTemplate; + + private static $projectSessionContextNameTemplate; + + private static $projectSessionEntityTypeNameTemplate; + + private static $sessionNameTemplate; + + private static $sessionEntityTypeNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getContextNameTemplate() + { + if (self::$contextNameTemplate == null) { + self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$contextNameTemplate; + } + + private static function getProjectEnvironmentUserSessionNameTemplate() + { + if (self::$projectEnvironmentUserSessionNameTemplate == null) { + self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectEnvironmentUserSessionNameTemplate; + } + + private static function getProjectEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { + self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectEnvironmentUserSessionEntityTypeNameTemplate() + { + if (self::$projectEnvironmentUserSessionEntityTypeNameTemplate == null) { + self::$projectEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectEnvironmentUserSessionEntityTypeNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); + } + + return self::$projectLocationEnvironmentUserSessionNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationEnvironmentUserSessionContextNameTemplate; + } + + private static function getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate() + { + if (self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate == null) { + self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate; + } + + private static function getProjectLocationSessionNameTemplate() + { + if (self::$projectLocationSessionNameTemplate == null) { + self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); + } + + return self::$projectLocationSessionNameTemplate; + } + + private static function getProjectLocationSessionContextNameTemplate() + { + if (self::$projectLocationSessionContextNameTemplate == null) { + self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectLocationSessionContextNameTemplate; + } + + private static function getProjectLocationSessionEntityTypeNameTemplate() + { + if (self::$projectLocationSessionEntityTypeNameTemplate == null) { + self::$projectLocationSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectLocationSessionEntityTypeNameTemplate; + } + + private static function getProjectSessionNameTemplate() + { + if (self::$projectSessionNameTemplate == null) { + self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$projectSessionNameTemplate; + } + + private static function getProjectSessionContextNameTemplate() + { + if (self::$projectSessionContextNameTemplate == null) { + self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); + } + + return self::$projectSessionContextNameTemplate; + } + + private static function getProjectSessionEntityTypeNameTemplate() + { + if (self::$projectSessionEntityTypeNameTemplate == null) { + self::$projectSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$projectSessionEntityTypeNameTemplate; + } + + private static function getSessionNameTemplate() + { + if (self::$sessionNameTemplate == null) { + self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); + } + + return self::$sessionNameTemplate; + } + + private static function getSessionEntityTypeNameTemplate() + { + if (self::$sessionEntityTypeNameTemplate == null) { + self::$sessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); + } + + return self::$sessionEntityTypeNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'context' => self::getContextNameTemplate(), + 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), + 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), + 'projectEnvironmentUserSessionEntityType' => self::getProjectEnvironmentUserSessionEntityTypeNameTemplate(), + 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), + 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), + 'projectLocationEnvironmentUserSessionEntityType' => self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate(), + 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), + 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), + 'projectLocationSessionEntityType' => self::getProjectLocationSessionEntityTypeNameTemplate(), + 'projectSession' => self::getProjectSessionNameTemplate(), + 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), + 'projectSessionEntityType' => self::getProjectSessionEntityTypeNameTemplate(), + 'session' => self::getSessionNameTemplate(), + 'sessionEntityType' => self::getSessionEntityTypeNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $session, $context) + { + return self::getContextNameTemplate()->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($project, $environment, $user, $session) + { + return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) + { + return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $environment, $user, $session, $entityType) + { + return self::getProjectEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $environment, $user, $session) + { + return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) + { + return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $environment, $user, $session, $entityType) + { + return self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $session) + { + return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) + { + return self::getProjectLocationSessionContextNameTemplate()->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($project, $location, $session, $entityType) + { + return self::getProjectLocationSessionEntityTypeNameTemplate()->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($project, $session) + { + return self::getProjectSessionNameTemplate()->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($project, $session, $context) + { + return self::getProjectSessionContextNameTemplate()->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($project, $session, $entityType) + { + return self::getProjectSessionEntityTypeNameTemplate()->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($project, $session) + { + return self::getSessionNameTemplate()->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($project, $session, $entityType) + { + return self::getSessionEntityTypeNameTemplate()->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} + * - 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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * 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). + * + * Sample code: + * ``` + * $sessionsClient = new SessionsClient(); + * try { + * $formattedSession = $sessionsClient->sessionName('[PROJECT]', '[SESSION]'); + * $queryInput = new QueryInput(); + * $response = $sessionsClient->detectIntent($formattedSession, $queryInput); + * } finally { + * $sessionsClient->close(); + * } + * ``` + * + * @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). + * @param 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. + * @param array $optionalArgs { + * Optional. + * + * @type QueryParameters $queryParams + * The parameters of this query. + * @type OutputAudioConfig $outputAudioConfig + * 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 FieldMask $outputAudioConfigMask + * 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 $inputAudio + * 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. + * @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 \Google\Cloud\Dialogflow\V2\DetectIntentResponse + * + * @throws ApiException if the remote call fails + */ + public function detectIntent($session, $queryInput, array $optionalArgs = []) + { + $request = new DetectIntentRequest(); + $requestParamHeaders = []; + $request->setSession($session); + $request->setQueryInput($queryInput); + $requestParamHeaders['session'] = $session; + if (isset($optionalArgs['queryParams'])) { + $request->setQueryParams($optionalArgs['queryParams']); + } + + if (isset($optionalArgs['outputAudioConfig'])) { + $request->setOutputAudioConfig($optionalArgs['outputAudioConfig']); + } + + if (isset($optionalArgs['outputAudioConfigMask'])) { + $request->setOutputAudioConfigMask($optionalArgs['outputAudioConfigMask']); + } + + if (isset($optionalArgs['inputAudio'])) { + $request->setInputAudio($optionalArgs['inputAudio']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DetectIntent', DetectIntentResponse::class, $optionalArgs, $request)->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). + * + * Sample code: + * ``` + * $sessionsClient = new SessionsClient(); + * try { + * $session = 'session'; + * $queryInput = new QueryInput(); + * $request = new StreamingDetectIntentRequest(); + * $request->setSession($session); + * $request->setQueryInput($queryInput); + * // Write all requests to the server, then read all responses until the + * // stream is complete + * $requests = [ + * $request, + * ]; + * $stream = $sessionsClient->streamingDetectIntent(); + * $stream->writeAll($requests); + * foreach ($stream->closeWriteAndReadAll() as $element) { + * // doSomethingWith($element); + * } + * // Alternatively: + * // Write requests individually, making read() calls if + * // required. Call closeWrite() once writes are complete, and read the + * // remaining responses from the server. + * $requests = [ + * $request, + * ]; + * $stream = $sessionsClient->streamingDetectIntent(); + * foreach ($requests as $request) { + * $stream->write($request); + * // if required, read a single response from the stream + * $element = $stream->read(); + * // doSomethingWith($element) + * } + * $stream->closeWrite(); + * $element = $stream->read(); + * while (!is_null($element)) { + * // doSomethingWith($element) + * $element = $stream->read(); + * } + * } finally { + * $sessionsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\BidiStream + * + * @throws ApiException if the remote call fails + */ + public function streamingDetectIntent(array $optionalArgs = []) + { + return $this->startCall('StreamingDetectIntent', StreamingDetectIntentResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $sessionsClient = new SessionsClient(); + * try { + * $response = $sessionsClient->getLocation(); + * } finally { + * $sessionsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $sessionsClient = new SessionsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $sessionsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sessionsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sessionsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php new file mode 100644 index 000000000000..3917117fc43a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php @@ -0,0 +1,782 @@ +agentName('[PROJECT]'); + * $version = new Version(); + * $response = $versionsClient->createVersion($formattedParent, $version); + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Dialogflow\V2\Client\VersionsClient} to use the new surface. + */ +class VersionsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Versions'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + 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 $agentNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationVersionNameTemplate; + + private static $projectVersionNameTemplate; + + private static $versionNameTemplate; + + private static $pathTemplateMap; + + 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', + ], + ], + ]; + } + + private static function getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getProjectAgentNameTemplate() + { + if (self::$projectAgentNameTemplate == null) { + self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$projectAgentNameTemplate; + } + + private static function getProjectLocationAgentNameTemplate() + { + if (self::$projectLocationAgentNameTemplate == null) { + self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); + } + + return self::$projectLocationAgentNameTemplate; + } + + private static function getProjectLocationVersionNameTemplate() + { + if (self::$projectLocationVersionNameTemplate == null) { + self::$projectLocationVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/versions/{version}'); + } + + return self::$projectLocationVersionNameTemplate; + } + + private static function getProjectVersionNameTemplate() + { + if (self::$projectVersionNameTemplate == null) { + self::$projectVersionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); + } + + return self::$projectVersionNameTemplate; + } + + private static function getVersionNameTemplate() + { + if (self::$versionNameTemplate == null) { + self::$versionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); + } + + return self::$versionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'agent' => self::getAgentNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationVersion' => self::getProjectLocationVersionNameTemplate(), + 'projectVersion' => self::getProjectVersionNameTemplate(), + 'version' => self::getVersionNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project) + { + return self::getAgentNameTemplate()->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($project) + { + return self::getProjectAgentNameTemplate()->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($project, $location) + { + return self::getProjectLocationAgentNameTemplate()->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($project, $location, $version) + { + return self::getProjectLocationVersionNameTemplate()->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($project, $version) + { + return self::getProjectVersionNameTemplate()->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($project, $version) + { + return self::getVersionNameTemplate()->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($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @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. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates an agent version. + * + * The new version points to the agent instance in the "default" environment. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * $formattedParent = $versionsClient->agentName('[PROJECT]'); + * $version = new Version(); + * $response = $versionsClient->createVersion($formattedParent, $version); + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to create a version for. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param Version $version Required. The version to create. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Version + * + * @throws ApiException if the remote call fails + */ + public function createVersion($parent, $version, array $optionalArgs = []) + { + $request = new CreateVersionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setVersion($version); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateVersion', Version::class, $optionalArgs, $request)->wait(); + } + + /** + * Delete the specified agent version. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * $formattedName = $versionsClient->versionName('[PROJECT]', '[VERSION]'); + * $versionsClient->deleteVersion($formattedName); + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the version to delete. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param array $optionalArgs { + * 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 if the remote call fails + */ + public function deleteVersion($name, array $optionalArgs = []) + { + $request = new DeleteVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteVersion', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified agent version. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * $formattedName = $versionsClient->versionName('[PROJECT]', '[VERSION]'); + * $response = $versionsClient->getVersion($formattedName); + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the version. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Version + * + * @throws ApiException if the remote call fails + */ + public function getVersion($name, array $optionalArgs = []) + { + $request = new GetVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetVersion', Version::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the list of all versions of the specified agent. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * $formattedParent = $versionsClient->agentName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $versionsClient->listVersions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $versionsClient->listVersions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param string $parent Required. The agent to list all versions from. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listVersions($parent, array $optionalArgs = []) + { + $request = new ListVersionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListVersions', $optionalArgs, ListVersionsResponse::class, $request); + } + + /** + * 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. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * $version = new Version(); + * $updateMask = new FieldMask(); + * $response = $versionsClient->updateVersion($version, $updateMask); + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param Version $version Required. The version to update. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param FieldMask $updateMask Required. The mask to control which fields get updated. + * @param array $optionalArgs { + * 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 \Google\Cloud\Dialogflow\V2\Version + * + * @throws ApiException if the remote call fails + */ + public function updateVersion($version, $updateMask, array $optionalArgs = []) + { + $request = new UpdateVersionRequest(); + $requestParamHeaders = []; + $request->setVersion($version); + $request->setUpdateMask($updateMask); + $requestParamHeaders['version.name'] = $version->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateVersion', Version::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * $response = $versionsClient->getLocation(); + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @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 \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $versionsClient = new VersionsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $versionsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $versionsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $versionsClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php new file mode 100644 index 000000000000..028165b14025 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php @@ -0,0 +1,34 @@ + [ + '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..1212b8a0f942 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php @@ -0,0 +1,250 @@ + [ + '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..62e4f6c73fdd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php @@ -0,0 +1,82 @@ + [ + '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' => [ + 'answerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectAnswerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'projectLocationAnswerRecord' => 'projects/{project}/locations/{location}/answerRecords/{answer_record}', + ], + ], + ], +]; 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..be58c5eb38bf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php @@ -0,0 +1,129 @@ + [ + '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..e66161c355f7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php @@ -0,0 +1,135 @@ + [ + '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..5aa624661cfd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php @@ -0,0 +1,245 @@ + [ + '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..ee1643d94e3f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php @@ -0,0 +1,135 @@ + [ + '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..762313f329f2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php @@ -0,0 +1,162 @@ + [ + '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..b783cf57c9e6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php @@ -0,0 +1,213 @@ + [ + '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..88d3051f1cbc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php @@ -0,0 +1,240 @@ + [ + '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..9b6a76ea2095 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php @@ -0,0 +1,169 @@ + [ + '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}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + '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..332fc52eec04 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php @@ -0,0 +1,220 @@ + [ + '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..4b4cc56a8955 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json @@ -0,0 +1,79 @@ +{ + "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" + }, + "GenerateStatelessSummary": { + "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" + }, + "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" + }, + "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..b9fd2614efc4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php @@ -0,0 +1,169 @@ + [ + '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', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'stateless_conversation.parent', + 'fieldAccessors' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + 'GetConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + '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', + '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}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + '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', + '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}', + '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/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..e2874160aaec --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php @@ -0,0 +1,214 @@ + [ + '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', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'GetConversation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + '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..93f28e5e2941 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php @@ -0,0 +1,197 @@ + [ + '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..f8d1387de2f2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php @@ -0,0 +1,260 @@ + [ + '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/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..75818f2640bd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php @@ -0,0 +1,214 @@ + [ + '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..76dd3e467342 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php @@ -0,0 +1,271 @@ + [ + '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..5fc9e95edee2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php @@ -0,0 +1,145 @@ + [ + '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..5953798d6344 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php @@ -0,0 +1,205 @@ + [ + '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..093e1dd5bc8f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php @@ -0,0 +1,72 @@ + [ + '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..272e028f1c81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php @@ -0,0 +1,129 @@ + [ + '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/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..9d492795e280 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php @@ -0,0 +1,167 @@ + [ + '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..6c5df8324599 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php @@ -0,0 +1,222 @@ + [ + '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..ce33699d01b7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php @@ -0,0 +1,118 @@ + [ + '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..c801f5cd5963 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php @@ -0,0 +1,198 @@ + [ + '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..7d7ae17012ef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json @@ -0,0 +1,109 @@ +{ + "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": [] + }, + "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": { + "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" + }, + "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..bedebe92aa35 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php @@ -0,0 +1,180 @@ + [ + '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', + ], + ], + ], + ], + '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}', + '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..29293e1cf8ba --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php @@ -0,0 +1,241 @@ + [ + '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', + ], + ], + ], + ], + '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..f0908f053be9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php @@ -0,0 +1,123 @@ + [ + '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..b2cf293b33a8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php @@ -0,0 +1,220 @@ + [ + '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..0b18316632c7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php @@ -0,0 +1,78 @@ + [ + '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}', + '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..b7cba0ec4c2e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php @@ -0,0 +1,115 @@ + [ + '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/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..06f584f447f3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php @@ -0,0 +1,119 @@ + [ + '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..0fce60904b1d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php @@ -0,0 +1,182 @@ + [ + '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/AgentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php new file mode 100644 index 000000000000..0115e3da93be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php @@ -0,0 +1,1012 @@ +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]'); + $gapicClient->deleteAgent($formattedParent); + $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]'); + try { + $gapicClient->deleteAgent($formattedParent); + // 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'; + $response = $gapicClient->exportAgent($formattedParent, $agentUri); + $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'; + $response = $gapicClient->exportAgent($formattedParent, $agentUri); + $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]'); + $response = $gapicClient->getAgent($formattedParent); + $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]'); + try { + $gapicClient->getAgent($formattedParent); + // 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]'); + $response = $gapicClient->getValidationResult($formattedParent); + $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]'); + try { + $gapicClient->getValidationResult($formattedParent); + // 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]'); + $response = $gapicClient->importAgent($formattedParent); + $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]'); + $response = $gapicClient->importAgent($formattedParent); + $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]'); + $response = $gapicClient->restoreAgent($formattedParent); + $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]'); + $response = $gapicClient->restoreAgent($formattedParent); + $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]'); + $response = $gapicClient->searchAgents($formattedParent); + $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]'); + try { + $gapicClient->searchAgents($formattedParent); + // 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); + $response = $gapicClient->setAgent($agent); + $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); + try { + $gapicClient->setAgent($agent); + // 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]'); + $response = $gapicClient->trainAgent($formattedParent); + $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]'); + $response = $gapicClient->trainAgent($formattedParent); + $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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php new file mode 100644 index 000000000000..804d1c0c9e59 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php @@ -0,0 +1,322 @@ +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]'); + $response = $gapicClient->listAnswerRecords($formattedParent); + $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]'); + try { + $gapicClient->listAnswerRecords($formattedParent); + // 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(); + $response = $gapicClient->updateAnswerRecord($answerRecord, $updateMask); + $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(); + try { + $gapicClient->updateAnswerRecord($answerRecord, $updateMask); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} 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..6e39018bac30 --- /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..aafd68dab8a6 --- /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..ca02b76bd31a --- /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..29e8ce86a2ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php @@ -0,0 +1,813 @@ +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; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $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; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $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; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $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..110d2a19e70e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php @@ -0,0 +1,1191 @@ +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'; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $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'; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $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'; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $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..3d5e4fe40bdf --- /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..0bd5f13f76a6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php @@ -0,0 +1,736 @@ +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 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 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 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 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..b1159a063774 --- /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/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php new file mode 100644 index 000000000000..71c17e49323a --- /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..e942e4407219 --- /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..a350fb74fbd1 --- /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/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php new file mode 100644 index 000000000000..aa572dd48cd3 --- /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..4bf41226d3f7 --- /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..a7250c8bd6f9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php @@ -0,0 +1,885 @@ +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'; + $expectedResponse = new StreamingAnalyzeContentResponse(); + $expectedResponse->setReplyText($replyText); + $transport->addResponse($expectedResponse); + $replyText2 = 'replyText2518940821'; + $expectedResponse2 = new StreamingAnalyzeContentResponse(); + $expectedResponse2->setReplyText($replyText2); + $transport->addResponse($expectedResponse2); + $replyText3 = 'replyText3518940822'; + $expectedResponse3 = new StreamingAnalyzeContentResponse(); + $expectedResponse3->setReplyText($replyText3); + $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 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..b2f6032cde96 --- /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..4848f48cb393 --- /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/VersionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php new file mode 100644 index 000000000000..a5b6e3c80f4b --- /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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php new file mode 100644 index 000000000000..e6d0c6a53c64 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php @@ -0,0 +1,565 @@ +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); + $response = $gapicClient->createContext($formattedParent, $context); + $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); + try { + $gapicClient->createContext($formattedParent, $context); + // 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]'); + $gapicClient->deleteAllContexts($formattedParent); + $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]'); + try { + $gapicClient->deleteAllContexts($formattedParent); + // 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]'); + $gapicClient->deleteContext($formattedName); + $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]'); + try { + $gapicClient->deleteContext($formattedName); + // 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]'); + $response = $gapicClient->getContext($formattedName); + $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]'); + try { + $gapicClient->getContext($formattedName); + // 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]'); + $response = $gapicClient->listContexts($formattedParent); + $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]'); + try { + $gapicClient->listContexts($formattedParent); + // 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); + $response = $gapicClient->updateContext($context); + $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); + try { + $gapicClient->updateContext($context); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php new file mode 100644 index 000000000000..c89e0f1221f4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php @@ -0,0 +1,700 @@ +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; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $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); + $response = $gapicClient->createConversationDataset($parent, $conversationDataset); + $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); + $response = $gapicClient->createConversationDataset($parent, $conversationDataset); + $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]'); + $response = $gapicClient->deleteConversationDataset($formattedName); + $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]'); + $response = $gapicClient->deleteConversationDataset($formattedName); + $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; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $response = $gapicClient->getConversationDataset($formattedName); + $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]'); + try { + $gapicClient->getConversationDataset($formattedName); + // 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(); + $response = $gapicClient->importConversationData($formattedName, $inputConfig); + $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(); + $response = $gapicClient->importConversationData($formattedName, $inputConfig); + $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]'); + $response = $gapicClient->listConversationDatasets($formattedParent); + $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]'); + try { + $gapicClient->listConversationDatasets($formattedParent); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php new file mode 100644 index 000000000000..bd9cb022b550 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php @@ -0,0 +1,1064 @@ +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'; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $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); + $response = $gapicClient->createConversationModel($conversationModel); + $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); + $response = $gapicClient->createConversationModel($conversationModel); + $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(); + $response = $gapicClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); + $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(); + $response = $gapicClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); + $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'; + $response = $gapicClient->deleteConversationModel($name); + $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'; + $response = $gapicClient->deleteConversationModel($name); + $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'; + $response = $gapicClient->deployConversationModel($name); + $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'; + $response = $gapicClient->deployConversationModel($name); + $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'; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->getConversationModel($name); + $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'; + try { + $gapicClient->getConversationModel($name); + // 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'; + $response = $gapicClient->getConversationModelEvaluation($name); + $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'; + try { + $gapicClient->getConversationModelEvaluation($name); + // 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'; + $response = $gapicClient->listConversationModelEvaluations($parent); + $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'; + try { + $gapicClient->listConversationModelEvaluations($parent); + // 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'; + $response = $gapicClient->listConversationModels($parent); + $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'; + try { + $gapicClient->listConversationModels($parent); + // 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'; + $response = $gapicClient->undeployConversationModel($name); + $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'; + $response = $gapicClient->undeployConversationModel($name); + $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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php new file mode 100644 index 000000000000..dd4e641e4a34 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php @@ -0,0 +1,808 @@ +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; + $response = $gapicClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); + $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; + $response = $gapicClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); + $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); + $response = $gapicClient->createConversationProfile($formattedParent, $conversationProfile); + $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); + try { + $gapicClient->createConversationProfile($formattedParent, $conversationProfile); + // 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]'); + $gapicClient->deleteConversationProfile($formattedName); + $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]'); + try { + $gapicClient->deleteConversationProfile($formattedName); + // 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]'); + $response = $gapicClient->getConversationProfile($formattedName); + $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]'); + try { + $gapicClient->getConversationProfile($formattedName); + // 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]'); + $response = $gapicClient->listConversationProfiles($formattedParent); + $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]'); + try { + $gapicClient->listConversationProfiles($formattedParent); + // 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(); + $response = $gapicClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); + $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(); + $response = $gapicClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); + $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(); + $response = $gapicClient->updateConversationProfile($conversationProfile, $updateMask); + $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(); + try { + $gapicClient->updateConversationProfile($conversationProfile, $updateMask); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php new file mode 100644 index 000000000000..628731b7dd5d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php @@ -0,0 +1,660 @@ +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]'); + $response = $gapicClient->completeConversation($formattedName); + $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]'); + try { + $gapicClient->completeConversation($formattedName); + // 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); + $response = $gapicClient->createConversation($formattedParent, $conversation); + $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); + try { + $gapicClient->createConversation($formattedParent, $conversation); + // 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); + $response = $gapicClient->generateStatelessSummary($statelessConversation, $conversationProfile); + $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); + try { + $gapicClient->generateStatelessSummary($statelessConversation, $conversationProfile); + // 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]'); + $response = $gapicClient->getConversation($formattedName); + $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]'); + try { + $gapicClient->getConversation($formattedName); + // 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]'); + $response = $gapicClient->listConversations($formattedParent); + $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]'); + try { + $gapicClient->listConversations($formattedParent); + // 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]'); + $response = $gapicClient->listMessages($formattedParent); + $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]'); + try { + $gapicClient->listMessages($formattedParent); + // 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]'); + $response = $gapicClient->suggestConversationSummary($formattedConversation); + $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]'); + try { + $gapicClient->suggestConversationSummary($formattedConversation); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php new file mode 100644 index 000000000000..51ffa88cba99 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php @@ -0,0 +1,1109 @@ +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); + $response = $gapicClient->createDocument($formattedParent, $document); + $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); + $response = $gapicClient->createDocument($formattedParent, $document); + $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]'); + $response = $gapicClient->deleteDocument($formattedName); + $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]'); + $response = $gapicClient->deleteDocument($formattedName); + $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]'); + $response = $gapicClient->exportDocument($formattedName); + $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]'); + $response = $gapicClient->exportDocument($formattedName); + $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]'); + $response = $gapicClient->getDocument($formattedName); + $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]'); + try { + $gapicClient->getDocument($formattedName); + // 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); + $response = $gapicClient->importDocuments($formattedParent, $documentTemplate); + $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); + $response = $gapicClient->importDocuments($formattedParent, $documentTemplate); + $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]'); + $response = $gapicClient->listDocuments($formattedParent); + $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]'); + try { + $gapicClient->listDocuments($formattedParent); + // 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]'); + $response = $gapicClient->reloadDocument($formattedName); + $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]'); + $response = $gapicClient->reloadDocument($formattedName); + $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); + $response = $gapicClient->updateDocument($document); + $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); + $response = $gapicClient->updateDocument($document); + $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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php new file mode 100644 index 000000000000..fe5f669b489e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php @@ -0,0 +1,1129 @@ +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 = []; + $response = $gapicClient->batchCreateEntities($formattedParent, $entities); + $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 = []; + $response = $gapicClient->batchCreateEntities($formattedParent, $entities); + $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 = []; + $response = $gapicClient->batchDeleteEntities($formattedParent, $entityValues); + $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 = []; + $response = $gapicClient->batchDeleteEntities($formattedParent, $entityValues); + $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 = []; + $response = $gapicClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); + $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 = []; + $response = $gapicClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); + $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 = []; + $response = $gapicClient->batchUpdateEntities($formattedParent, $entities); + $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 = []; + $response = $gapicClient->batchUpdateEntities($formattedParent, $entities); + $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]'); + $response = $gapicClient->batchUpdateEntityTypes($formattedParent); + $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]'); + $response = $gapicClient->batchUpdateEntityTypes($formattedParent); + $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); + $response = $gapicClient->createEntityType($formattedParent, $entityType); + $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); + try { + $gapicClient->createEntityType($formattedParent, $entityType); + // 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]'); + $gapicClient->deleteEntityType($formattedName); + $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]'); + try { + $gapicClient->deleteEntityType($formattedName); + // 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]'); + $response = $gapicClient->getEntityType($formattedName); + $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]'); + try { + $gapicClient->getEntityType($formattedName); + // 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]'); + $response = $gapicClient->listEntityTypes($formattedParent); + $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]'); + try { + $gapicClient->listEntityTypes($formattedParent); + // 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); + $response = $gapicClient->updateEntityType($entityType); + $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); + try { + $gapicClient->updateEntityType($entityType); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php new file mode 100644 index 000000000000..82413ceeb063 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php @@ -0,0 +1,587 @@ +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'; + $response = $gapicClient->createEnvironment($formattedParent, $environment, $environmentId); + $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'; + try { + $gapicClient->createEnvironment($formattedParent, $environment, $environmentId); + // 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]'); + $gapicClient->deleteEnvironment($formattedName); + $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]'); + try { + $gapicClient->deleteEnvironment($formattedName); + // 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]'); + $response = $gapicClient->getEnvironment($formattedName); + $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]'); + try { + $gapicClient->getEnvironment($formattedName); + // 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]'); + $response = $gapicClient->getEnvironmentHistory($formattedParent); + $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]'); + try { + $gapicClient->getEnvironmentHistory($formattedParent); + // 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]'); + $response = $gapicClient->listEnvironments($formattedParent); + $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]'); + try { + $gapicClient->listEnvironments($formattedParent); + // 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(); + $response = $gapicClient->updateEnvironment($environment, $updateMask); + $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(); + try { + $gapicClient->updateEnvironment($environment, $updateMask); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php new file mode 100644 index 000000000000..7a9fdc6fd390 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php @@ -0,0 +1,320 @@ +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]'); + $response = $gapicClient->getFulfillment($formattedName); + $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]'); + try { + $gapicClient->getFulfillment($formattedName); + // 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(); + $response = $gapicClient->updateFulfillment($fulfillment, $updateMask); + $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(); + try { + $gapicClient->updateFulfillment($fulfillment, $updateMask); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php new file mode 100644 index 000000000000..6ed657d29084 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php @@ -0,0 +1,805 @@ +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 = []; + $response = $gapicClient->batchDeleteIntents($formattedParent, $intents); + $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 = []; + $response = $gapicClient->batchDeleteIntents($formattedParent, $intents); + $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]'); + $response = $gapicClient->batchUpdateIntents($formattedParent); + $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]'); + $response = $gapicClient->batchUpdateIntents($formattedParent); + $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); + $response = $gapicClient->createIntent($formattedParent, $intent); + $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); + try { + $gapicClient->createIntent($formattedParent, $intent); + // 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]'); + $gapicClient->deleteIntent($formattedName); + $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]'); + try { + $gapicClient->deleteIntent($formattedName); + // 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]'); + $response = $gapicClient->getIntent($formattedName); + $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]'); + try { + $gapicClient->getIntent($formattedName); + // 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]'); + $response = $gapicClient->listIntents($formattedParent); + $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]'); + try { + $gapicClient->listIntents($formattedParent); + // 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); + $response = $gapicClient->updateIntent($intent); + $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); + try { + $gapicClient->updateIntent($intent); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php new file mode 100644 index 000000000000..3169e40de146 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php @@ -0,0 +1,514 @@ +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); + $response = $gapicClient->createKnowledgeBase($formattedParent, $knowledgeBase); + $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); + try { + $gapicClient->createKnowledgeBase($formattedParent, $knowledgeBase); + // 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]'); + $gapicClient->deleteKnowledgeBase($formattedName); + $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]'); + try { + $gapicClient->deleteKnowledgeBase($formattedName); + // 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]'); + $response = $gapicClient->getKnowledgeBase($formattedName); + $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]'); + try { + $gapicClient->getKnowledgeBase($formattedName); + // 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]'); + $response = $gapicClient->listKnowledgeBases($formattedParent); + $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]'); + try { + $gapicClient->listKnowledgeBases($formattedParent); + // 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); + $response = $gapicClient->updateKnowledgeBase($knowledgeBase); + $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); + try { + $gapicClient->updateKnowledgeBase($knowledgeBase); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php new file mode 100644 index 000000000000..743e23e02211 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php @@ -0,0 +1,806 @@ +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]'); + $response = $gapicClient->analyzeContent($formattedParticipant); + $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]'); + try { + $gapicClient->analyzeContent($formattedParticipant); + // 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(); + $response = $gapicClient->createParticipant($formattedParent, $participant); + $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(); + try { + $gapicClient->createParticipant($formattedParent, $participant); + // 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]'); + $response = $gapicClient->getParticipant($formattedName); + $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]'); + try { + $gapicClient->getParticipant($formattedName); + // 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]'); + $response = $gapicClient->listParticipants($formattedParent); + $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]'); + try { + $gapicClient->listParticipants($formattedParent); + // 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'; + $expectedResponse = new StreamingAnalyzeContentResponse(); + $expectedResponse->setReplyText($replyText); + $transport->addResponse($expectedResponse); + $replyText2 = 'replyText2518940821'; + $expectedResponse2 = new StreamingAnalyzeContentResponse(); + $expectedResponse2->setReplyText($replyText2); + $transport->addResponse($expectedResponse2); + $replyText3 = 'replyText3518940822'; + $expectedResponse3 = new StreamingAnalyzeContentResponse(); + $expectedResponse3->setReplyText($replyText3); + $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]'); + $response = $gapicClient->suggestArticles($formattedParent); + $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]'); + try { + $gapicClient->suggestArticles($formattedParent); + // 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]'); + $response = $gapicClient->suggestFaqAnswers($formattedParent); + $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]'); + try { + $gapicClient->suggestFaqAnswers($formattedParent); + // 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]'); + $response = $gapicClient->suggestSmartReplies($formattedParent); + $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]'); + try { + $gapicClient->suggestSmartReplies($formattedParent); + // 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(); + $response = $gapicClient->updateParticipant($participant, $updateMask); + $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(); + try { + $gapicClient->updateParticipant($participant, $updateMask); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php new file mode 100644 index 000000000000..66fa4a84a586 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php @@ -0,0 +1,519 @@ +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); + $response = $gapicClient->createSessionEntityType($formattedParent, $sessionEntityType); + $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); + try { + $gapicClient->createSessionEntityType($formattedParent, $sessionEntityType); + // 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]'); + $gapicClient->deleteSessionEntityType($formattedName); + $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]'); + try { + $gapicClient->deleteSessionEntityType($formattedName); + // 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]'); + $response = $gapicClient->getSessionEntityType($formattedName); + $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]'); + try { + $gapicClient->getSessionEntityType($formattedName); + // 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]'); + $response = $gapicClient->listSessionEntityTypes($formattedParent); + $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]'); + try { + $gapicClient->listSessionEntityTypes($formattedParent); + // 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); + $response = $gapicClient->updateSessionEntityType($sessionEntityType); + $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); + try { + $gapicClient->updateSessionEntityType($sessionEntityType); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php new file mode 100644 index 000000000000..d8b818a6bb74 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php @@ -0,0 +1,365 @@ +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(); + $response = $gapicClient->detectIntent($formattedSession, $queryInput); + $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(); + try { + $gapicClient->detectIntent($formattedSession, $queryInput); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php new file mode 100644 index 000000000000..004f7d2889c4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php @@ -0,0 +1,511 @@ +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(); + $response = $gapicClient->createVersion($formattedParent, $version); + $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(); + try { + $gapicClient->createVersion($formattedParent, $version); + // 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]'); + $gapicClient->deleteVersion($formattedName); + $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]'); + try { + $gapicClient->deleteVersion($formattedName); + // 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]'); + $response = $gapicClient->getVersion($formattedName); + $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]'); + try { + $gapicClient->getVersion($formattedName); + // 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]'); + $response = $gapicClient->listVersions($formattedParent); + $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]'); + try { + $gapicClient->listVersions($formattedParent); + // 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(); + $response = $gapicClient->updateVersion($version, $updateMask); + $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(); + try { + $gapicClient->updateVersion($version, $updateMask); + // 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); + $response = $gapicClient->getLocation(); + $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); + try { + $gapicClient->getLocation(); + // 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); + $response = $gapicClient->listLocations(); + $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); + try { + $gapicClient->listLocations(); + // 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()); + } +} From 575c3984faacd4400756766240a512efe2f4b215 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 20 Jun 2023 22:02:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../metadata/V2/ConversationProfile.php | Bin 11111 -> 11256 bytes Dialogflow/metadata/V2/Document.php | Bin 7753 -> 7758 bytes Dialogflow/src/V2/AnswerFeedback.php | 16 +- Dialogflow/src/V2/AutomatedAgentConfig.php | 56 + Dialogflow/src/V2/Document.php | 8 +- .../src/V2/Gapic/ConversationsGapicClient.php | 2 +- .../src/V2/Gapic/DocumentsGapicClient.php | 2 +- .../SuggestionQueryConfig.php | 12 +- .../DialogflowQuerySource.php | 8 +- Dialogflow/src/V2/ImportDocumentsRequest.php | 10 +- .../V2/SuggestConversationSummaryRequest.php | 8 +- .../Google/Cloud/Dialogflow/V2/Agent.php | Bin 5894 -> 0 bytes .../Cloud/Dialogflow/V2/AnswerRecord.php | Bin 4426 -> 0 bytes .../Cloud/Dialogflow/V2/AudioConfig.php | Bin 3603 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Context.php | 70 - .../Cloud/Dialogflow/V2/Conversation.php | Bin 6974 -> 0 bytes .../Dialogflow/V2/ConversationDataset.php | Bin 5192 -> 0 bytes .../Cloud/Dialogflow/V2/ConversationEvent.php | Bin 1358 -> 0 bytes .../Cloud/Dialogflow/V2/ConversationModel.php | Bin 9183 -> 0 bytes .../Dialogflow/V2/ConversationProfile.php | Bin 11256 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Document.php | Bin 7758 -> 0 bytes .../Google/Cloud/Dialogflow/V2/EntityType.php | Bin 7509 -> 0 bytes .../Cloud/Dialogflow/V2/Environment.php | Bin 5522 -> 0 bytes .../Cloud/Dialogflow/V2/Fulfillment.php | Bin 2908 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Gcs.php | 33 - .../V2/HumanAgentAssistantEvent.php | 32 - .../Google/Cloud/Dialogflow/V2/Intent.php | Bin 12742 -> 0 bytes .../Cloud/Dialogflow/V2/KnowledgeBase.php | 66 - .../Cloud/Dialogflow/V2/Participant.php | Bin 12033 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Session.php | Bin 7687 -> 0 bytes .../Cloud/Dialogflow/V2/SessionEntityType.php | Bin 5745 -> 0 bytes .../Cloud/Dialogflow/V2/ValidationResult.php | Bin 1126 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Version.php | Bin 3769 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Webhook.php | 50 - .../src/Google/Cloud/Dialogflow/V2/Agent.php | 541 ------ .../Cloud/Dialogflow/V2/Agent/ApiVersion.php | 71 - .../Cloud/Dialogflow/V2/Agent/MatchMode.php | 66 - .../Google/Cloud/Dialogflow/V2/Agent/Tier.php | 72 - .../Dialogflow/V2/AgentAssistantFeedback.php | 243 --- .../AnswerRelevance.php | 64 - .../DocumentCorrectness.php | 64 - .../DocumentEfficiency.php | 64 - .../SummarizationFeedback.php | 158 -- .../Dialogflow/V2/AgentAssistantRecord.php | 108 -- .../Dialogflow/V2/AnalyzeContentRequest.php | 437 ----- .../Dialogflow/V2/AnalyzeContentResponse.php | 428 ---- .../Dialogflow/V2/AnnotatedMessagePart.php | 195 -- .../Cloud/Dialogflow/V2/AnswerFeedback.php | 282 --- .../V2/AnswerFeedback/CorrectnessLevel.php | 71 - .../Cloud/Dialogflow/V2/AnswerRecord.php | 189 -- .../Cloud/Dialogflow/V2/ArticleAnswer.php | 261 --- .../V2/ArticleSuggestionModelMetadata.php | 71 - .../Dialogflow/V2/AssistQueryParameters.php | 131 -- .../Cloud/Dialogflow/V2/AudioEncoding.php | 118 -- .../Dialogflow/V2/AutomatedAgentConfig.php | 175 -- .../Dialogflow/V2/AutomatedAgentReply.php | 203 -- .../AutomatedAgentReplyType.php | 70 - .../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 - ...ggestionFeatureConfigOperationMetadata.php | 192 -- .../ClearSuggestionFeatureConfigRequest.php | 184 -- .../V2/CloudConversationDebuggingInfo.php | 706 ------- .../V2/CompleteConversationRequest.php | 92 - .../Google/Cloud/Dialogflow/V2/Context.php | 269 --- .../Cloud/Dialogflow/V2/Conversation.php | 380 ---- .../V2/Conversation/ConversationStage.php | 69 - .../V2/Conversation/LifecycleState.php | 64 - .../Dialogflow/V2/ConversationDataset.php | 316 --- .../Cloud/Dialogflow/V2/ConversationEvent.php | 200 -- .../Dialogflow/V2/ConversationEvent/Type.php | 96 - .../Cloud/Dialogflow/V2/ConversationInfo.php | 75 - .../Cloud/Dialogflow/V2/ConversationModel.php | 346 ---- .../V2/ConversationModel/ModelType.php | 64 - .../Dialogflow/V2/ConversationModel/State.php | 108 -- .../V2/ConversationModelEvaluation.php | 329 ---- .../Dialogflow/V2/ConversationPhoneNumber.php | 68 - .../Dialogflow/V2/ConversationProfile.php | 703 ------- .../Dialogflow/V2/CreateContextRequest.php | 153 -- ...teConversationDatasetOperationMetadata.php | 75 - .../V2/CreateConversationDatasetRequest.php | 132 -- ...sationModelEvaluationOperationMetadata.php | 201 -- .../State.php | 85 - ...eateConversationModelEvaluationRequest.php | 138 -- ...eateConversationModelOperationMetadata.php | 155 -- .../State.php | 94 - .../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 -- .../Dialogflow/V2/CreateIntentRequest.php | 240 --- .../V2/CreateKnowledgeBaseRequest.php | 133 -- .../V2/CreateParticipantRequest.php | 138 -- .../V2/CreateSessionEntityTypeRequest.php | 153 -- .../Dialogflow/V2/CreateVersionRequest.php | 144 -- .../Dialogflow/V2/DeleteAgentRequest.php | 87 - .../V2/DeleteAllContextsRequest.php | 107 - .../Dialogflow/V2/DeleteContextRequest.php | 107 - ...teConversationDatasetOperationMetadata.php | 33 - .../V2/DeleteConversationDatasetRequest.php | 92 - ...leteConversationModelOperationMetadata.php | 121 -- .../V2/DeleteConversationModelRequest.php | 86 - .../V2/DeleteConversationProfileRequest.php | 94 - .../Dialogflow/V2/DeleteDocumentRequest.php | 92 - .../Dialogflow/V2/DeleteEntityTypeRequest.php | 87 - .../V2/DeleteEnvironmentRequest.php | 88 - .../Dialogflow/V2/DeleteIntentRequest.php | 92 - .../V2/DeleteKnowledgeBaseRequest.php | 130 -- .../V2/DeleteSessionEntityTypeRequest.php | 112 -- .../Dialogflow/V2/DeleteVersionRequest.php | 103 - ...ployConversationModelOperationMetadata.php | 121 -- .../V2/DeployConversationModelRequest.php | 72 - .../Dialogflow/V2/DetectIntentRequest.php | 428 ---- .../Dialogflow/V2/DetectIntentResponse.php | 273 --- .../Google/Cloud/Dialogflow/V2/Document.php | 500 ----- .../Dialogflow/V2/Document/KnowledgeType.php | 85 - .../Dialogflow/V2/Document/ReloadStatus.php | 132 -- .../Cloud/Dialogflow/V2/Document/State.php | 85 - .../Cloud/Dialogflow/V2/DtmfParameters.php | 67 - .../Google/Cloud/Dialogflow/V2/EntityType.php | 274 --- .../V2/EntityType/AutoExpansionMode.php | 60 - .../Cloud/Dialogflow/V2/EntityType/Entity.php | 148 -- .../Cloud/Dialogflow/V2/EntityType/Kind.php | 75 - .../Cloud/Dialogflow/V2/EntityTypeBatch.php | 67 - .../Cloud/Dialogflow/V2/Environment.php | 362 ---- .../Cloud/Dialogflow/V2/Environment/State.php | 75 - .../Dialogflow/V2/EnvironmentHistory.php | 164 -- .../V2/EnvironmentHistory/Entry.php | 148 -- .../Cloud/Dialogflow/V2/EvaluationConfig.php | 142 -- .../EvaluationConfig/SmartComposeConfig.php | 124 -- .../V2/EvaluationConfig/SmartReplyConfig.php | 124 -- .../Google/Cloud/Dialogflow/V2/EventInput.php | 229 --- .../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/Fulfillment.php | 247 --- .../Dialogflow/V2/Fulfillment/Feature.php | 70 - .../V2/Fulfillment/Feature/Type.php | 57 - .../V2/Fulfillment/GenericWebService.php | 236 --- .../Cloud/Dialogflow/V2/GcsDestination.php | 83 - .../Google/Cloud/Dialogflow/V2/GcsSources.php | 75 - .../V2/GenerateStatelessSummaryRequest.php | 222 --- .../MinimalConversation.php | 125 -- .../V2/GenerateStatelessSummaryResponse.php | 166 -- .../Summary.php | 112 -- .../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 - .../Dialogflow/V2/GetEntityTypeRequest.php | 158 -- .../V2/GetEnvironmentHistoryRequest.php | 160 -- .../Dialogflow/V2/GetEnvironmentRequest.php | 88 - .../Dialogflow/V2/GetFulfillmentRequest.php | 87 - .../Cloud/Dialogflow/V2/GetIntentRequest.php | 192 -- .../Dialogflow/V2/GetKnowledgeBaseRequest.php | 92 - .../Dialogflow/V2/GetParticipantRequest.php | 92 - .../V2/GetSessionEntityTypeRequest.php | 112 -- .../V2/GetValidationResultRequest.php | 122 -- .../Cloud/Dialogflow/V2/GetVersionRequest.php | 103 - .../V2/HumanAgentAssistantConfig.php | 217 --- .../ConversationModelConfig.php | 138 -- .../ConversationProcessConfig.php | 74 - .../MessageAnalysisConfig.php | 196 -- .../SuggestionConfig.php | 140 -- .../SuggestionFeatureConfig.php | 302 --- .../SuggestionQueryConfig.php | 326 ---- .../ContextFilterSettings.php | 143 -- .../DialogflowQuerySource.php | 83 - .../DocumentQuerySource.php | 83 - .../KnowledgeBaseQuerySource.php | 83 - .../SuggestionTriggerSettings.php | 108 -- .../V2/HumanAgentAssistantEvent.php | 148 -- .../Dialogflow/V2/HumanAgentHandoffConfig.php | 111 -- .../LivePersonConfig.php | 74 - .../SalesforceLiveAgentConfig.php | 184 -- .../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 - .../Cloud/Dialogflow/V2/InputAudioConfig.php | 624 ------ .../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 | 112 -- .../Cloud/Dialogflow/V2/Intent/Message.php | 545 ------ .../V2/Intent/Message/BasicCard.php | 216 --- .../V2/Intent/Message/BasicCard/Button.php | 114 -- .../BasicCard/Button/OpenUriAction.php | 70 - .../V2/Intent/Message/BrowseCarouselCard.php | 113 -- .../BrowseCarouselCardItem.php | 234 --- .../BrowseCarouselCardItem/OpenUrlAction.php | 108 -- .../OpenUrlAction/UrlTypeHint.php | 65 - .../ImageDisplayOptions.php | 89 - .../Dialogflow/V2/Intent/Message/Card.php | 172 -- .../V2/Intent/Message/Card/Button.php | 108 -- .../V2/Intent/Message/CarouselSelect.php | 70 - .../V2/Intent/Message/CarouselSelect/Item.php | 192 -- .../V2/Intent/Message/ColumnProperties.php | 105 - .../ColumnProperties/HorizontalAlignment.php | 71 - .../Dialogflow/V2/Intent/Message/Image.php | 108 -- .../V2/Intent/Message/LinkOutSuggestion.php | 109 -- .../V2/Intent/Message/ListSelect.php | 138 -- .../V2/Intent/Message/ListSelect/Item.php | 192 -- .../V2/Intent/Message/MediaContent.php | 104 - .../MediaContent/ResponseMediaObject.php | 213 -- .../MediaContent/ResponseMediaType.php | 57 - .../Dialogflow/V2/Intent/Message/Platform.php | 116 -- .../V2/Intent/Message/QuickReplies.php | 104 - .../V2/Intent/Message/SelectItemInfo.php | 113 -- .../V2/Intent/Message/SimpleResponse.php | 150 -- .../V2/Intent/Message/SimpleResponses.php | 73 - .../V2/Intent/Message/Suggestion.php | 71 - .../V2/Intent/Message/Suggestions.php | 70 - .../V2/Intent/Message/TableCard.php | 250 --- .../V2/Intent/Message/TableCardCell.php | 71 - .../V2/Intent/Message/TableCardRow.php | 104 - .../Dialogflow/V2/Intent/Message/Text.php | 70 - .../Cloud/Dialogflow/V2/Intent/Parameter.php | 360 ---- .../Dialogflow/V2/Intent/TrainingPhrase.php | 240 --- .../V2/Intent/TrainingPhrase/Part.php | 196 -- .../V2/Intent/TrainingPhrase/Type.php | 70 - .../Dialogflow/V2/Intent/WebhookState.php | 65 - .../Cloud/Dialogflow/V2/IntentBatch.php | 67 - .../Google/Cloud/Dialogflow/V2/IntentView.php | 56 - .../Cloud/Dialogflow/V2/KnowledgeBase.php | 166 -- .../V2/KnowledgeOperationMetadata.php | 143 -- .../V2/KnowledgeOperationMetadata/State.php | 71 - .../V2/ListAnswerRecordsRequest.php | 231 --- .../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 | 249 --- .../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 -- .../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/ListVersionsRequest.php | 170 -- .../Dialogflow/V2/ListVersionsResponse.php | 110 -- .../Cloud/Dialogflow/V2/LoggingConfig.php | 79 - .../Google/Cloud/Dialogflow/V2/Message.php | 395 ---- .../Cloud/Dialogflow/V2/MessageAnnotation.php | 109 -- .../Dialogflow/V2/NotificationConfig.php | 149 -- .../V2/NotificationConfig/MessageFormat.php | 64 - .../V2/OriginalDetectIntentRequest.php | 202 -- .../Cloud/Dialogflow/V2/OutputAudio.php | 115 -- .../Cloud/Dialogflow/V2/OutputAudioConfig.php | 163 -- .../Dialogflow/V2/OutputAudioEncoding.php | 86 - .../Cloud/Dialogflow/V2/Participant.php | 387 ---- .../Cloud/Dialogflow/V2/Participant/Role.php | 72 - .../Google/Cloud/Dialogflow/V2/QueryInput.php | 148 -- .../Cloud/Dialogflow/V2/QueryParameters.php | 415 ---- .../Cloud/Dialogflow/V2/QueryResult.php | 855 -------- .../Dialogflow/V2/ReloadDocumentRequest.php | 225 --- .../Dialogflow/V2/RestoreAgentRequest.php | 165 -- .../Dialogflow/V2/SearchAgentsRequest.php | 159 -- .../Dialogflow/V2/SearchAgentsResponse.php | 110 -- .../Google/Cloud/Dialogflow/V2/Sentiment.php | 112 -- .../V2/SentimentAnalysisRequestConfig.php | 75 - .../Dialogflow/V2/SentimentAnalysisResult.php | 89 - .../Cloud/Dialogflow/V2/SessionEntityType.php | 181 -- .../SessionEntityType/EntityOverrideMode.php | 73 - .../Cloud/Dialogflow/V2/SetAgentRequest.php | 135 -- ...ggestionFeatureConfigOperationMetadata.php | 192 -- .../V2/SetSuggestionFeatureConfigRequest.php | 194 -- .../Cloud/Dialogflow/V2/SmartReplyAnswer.php | 155 -- .../Cloud/Dialogflow/V2/SmartReplyMetrics.php | 143 -- .../V2/SmartReplyMetrics/TopNMetrics.php | 124 -- .../Dialogflow/V2/SmartReplyModelMetadata.php | 71 - .../Cloud/Dialogflow/V2/SpeechContext.php | 162 -- .../Dialogflow/V2/SpeechModelVariant.php | 92 - .../Dialogflow/V2/SpeechToTextConfig.php | 158 -- .../Cloud/Dialogflow/V2/SpeechWordInfo.php | 225 --- .../Cloud/Dialogflow/V2/SsmlVoiceGender.php | 70 - .../V2/StreamingAnalyzeContentRequest.php | 603 ------ .../V2/StreamingAnalyzeContentResponse.php | 500 ----- .../V2/StreamingDetectIntentRequest.php | 522 ----- .../V2/StreamingDetectIntentResponse.php | 371 ---- .../V2/StreamingRecognitionResult.php | 363 ---- .../MessageType.php | 71 - .../Dialogflow/V2/SuggestArticlesRequest.php | 228 --- .../Dialogflow/V2/SuggestArticlesResponse.php | 168 -- .../V2/SuggestConversationSummaryRequest.php | 228 --- .../V2/SuggestConversationSummaryResponse.php | 170 -- .../Summary.php | 150 -- .../V2/SuggestFaqAnswersRequest.php | 224 --- .../V2/SuggestFaqAnswersResponse.php | 168 -- .../V2/SuggestSmartRepliesRequest.php | 232 --- .../V2/SuggestSmartRepliesResponse.php | 176 -- .../Cloud/Dialogflow/V2/SuggestionFeature.php | 69 - .../Dialogflow/V2/SuggestionFeature/Type.php | 71 - .../Cloud/Dialogflow/V2/SuggestionResult.php | 180 -- .../Dialogflow/V2/SynthesizeSpeechConfig.php | 269 --- .../Cloud/Dialogflow/V2/TelephonyDtmf.php | 160 -- .../Dialogflow/V2/TelephonyDtmfEvents.php | 67 - .../Google/Cloud/Dialogflow/V2/TextInput.php | 119 -- .../Dialogflow/V2/TextToSpeechSettings.php | 197 -- .../Cloud/Dialogflow/V2/TrainAgentRequest.php | 87 - ...ployConversationModelOperationMetadata.php | 121 -- .../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/UpdateIntentRequest.php | 246 --- .../V2/UpdateKnowledgeBaseRequest.php | 147 -- .../V2/UpdateParticipantRequest.php | 137 -- .../V2/UpdateSessionEntityTypeRequest.php | 150 -- .../Dialogflow/V2/UpdateVersionRequest.php | 158 -- .../Cloud/Dialogflow/V2/ValidationError.php | 183 -- .../V2/ValidationError/Severity.php | 78 - .../Cloud/Dialogflow/V2/ValidationResult.php | 67 - .../Google/Cloud/Dialogflow/V2/Version.php | 254 --- .../Dialogflow/V2/Version/VersionStatus.php | 71 - .../Dialogflow/V2/VoiceSelectionParams.php | 129 -- .../Cloud/Dialogflow/V2/WebhookRequest.php | 217 --- .../Cloud/Dialogflow/V2/WebhookResponse.php | 430 ---- .../samples/V2/AgentsClient/delete_agent.php | 65 - .../samples/V2/AgentsClient/export_agent.php | 99 - .../v2/samples/V2/AgentsClient/get_agent.php | 67 - .../samples/V2/AgentsClient/get_location.php | 53 - .../V2/AgentsClient/get_validation_result.php | 68 - .../samples/V2/AgentsClient/import_agent.php | 102 - .../V2/AgentsClient/list_locations.php | 58 - .../samples/V2/AgentsClient/restore_agent.php | 100 - .../samples/V2/AgentsClient/search_agents.php | 78 - .../v2/samples/V2/AgentsClient/set_agent.php | 99 - .../samples/V2/AgentsClient/train_agent.php | 89 - .../V2/AnswerRecordsClient/get_location.php | 53 - .../list_answer_records.php | 74 - .../V2/AnswerRecordsClient/list_locations.php | 58 - .../update_answer_record.php | 61 - .../V2/ContextsClient/create_context.php | 95 - .../V2/ContextsClient/delete_all_contexts.php | 69 - .../V2/ContextsClient/delete_context.php | 69 - .../samples/V2/ContextsClient/get_context.php | 71 - .../V2/ContextsClient/get_location.php | 53 - .../V2/ContextsClient/list_contexts.php | 76 - .../V2/ContextsClient/list_locations.php | 58 - .../V2/ContextsClient/update_context.php | 85 - .../create_conversation_dataset.php | 95 - .../delete_conversation_dataset.php | 90 - .../get_conversation_dataset.php | 72 - .../get_location.php | 53 - .../import_conversation_data.php | 99 - .../list_conversation_datasets.php | 73 - .../list_locations.php | 58 - .../create_conversation_model.php | 109 -- .../create_conversation_model_evaluation.php | 90 - .../delete_conversation_model.php | 84 - .../deploy_conversation_model.php | 87 - .../get_conversation_model.php | 66 - .../get_conversation_model_evaluation.php | 67 - .../ConversationModelsClient/get_location.php | 53 - .../list_conversation_model_evaluations.php | 71 - .../list_conversation_models.php | 71 - .../list_locations.php | 58 - .../undeploy_conversation_model.php | 87 - .../clear_suggestion_feature_config.php | 107 - .../create_conversation_profile.php | 83 - .../delete_conversation_profile.php | 69 - .../get_conversation_profile.php | 71 - .../get_location.php | 53 - .../list_conversation_profiles.php | 72 - .../list_locations.php | 58 - .../set_suggestion_feature_config.php | 110 -- .../update_conversation_profile.php | 79 - .../complete_conversation.php | 69 - .../create_conversation.php | 102 - .../generate_stateless_summary.php | 98 - .../ConversationsClient/get_conversation.php | 68 - .../V2/ConversationsClient/get_location.php | 53 - .../list_conversations.php | 72 - .../V2/ConversationsClient/list_locations.php | 58 - .../V2/ConversationsClient/list_messages.php | 77 - .../suggest_conversation_summary.php | 70 - .../V2/DocumentsClient/create_document.php | 112 -- .../V2/DocumentsClient/delete_document.php | 86 - .../V2/DocumentsClient/export_document.php | 89 - .../V2/DocumentsClient/get_document.php | 68 - .../V2/DocumentsClient/get_location.php | 53 - .../V2/DocumentsClient/import_documents.php | 110 -- .../V2/DocumentsClient/list_documents.php | 73 - .../V2/DocumentsClient/list_locations.php | 58 - .../V2/DocumentsClient/reload_document.php | 94 - .../V2/DocumentsClient/update_document.php | 101 - .../batch_create_entities.php | 121 -- .../batch_delete_entities.php | 96 - .../batch_delete_entity_types.php | 97 - .../batch_update_entities.php | 124 -- .../batch_update_entity_types.php | 92 - .../EntityTypesClient/create_entity_type.php | 84 - .../EntityTypesClient/delete_entity_type.php | 69 - .../V2/EntityTypesClient/get_entity_type.php | 67 - .../V2/EntityTypesClient/get_location.php | 53 - .../EntityTypesClient/list_entity_types.php | 72 - .../V2/EntityTypesClient/list_locations.php | 58 - .../EntityTypesClient/update_entity_type.php | 77 - .../EnvironmentsClient/create_environment.php | 75 - .../EnvironmentsClient/delete_environment.php | 71 - .../V2/EnvironmentsClient/get_environment.php | 73 - .../get_environment_history.php | 78 - .../V2/EnvironmentsClient/get_location.php | 53 - .../EnvironmentsClient/list_environments.php | 75 - .../V2/EnvironmentsClient/list_locations.php | 58 - .../EnvironmentsClient/update_environment.php | 69 - .../V2/FulfillmentsClient/get_fulfillment.php | 67 - .../V2/FulfillmentsClient/get_location.php | 53 - .../V2/FulfillmentsClient/list_locations.php | 58 - .../FulfillmentsClient/update_fulfillment.php | 77 - .../V2/IntentsClient/batch_delete_intents.php | 97 - .../V2/IntentsClient/batch_update_intents.php | 92 - .../V2/IntentsClient/create_intent.php | 77 - .../V2/IntentsClient/delete_intent.php | 70 - .../samples/V2/IntentsClient/get_intent.php | 67 - .../samples/V2/IntentsClient/get_location.php | 53 - .../samples/V2/IntentsClient/list_intents.php | 80 - .../V2/IntentsClient/list_locations.php | 58 - .../V2/IntentsClient/update_intent.php | 73 - .../create_knowledge_base.php | 76 - .../delete_knowledge_base.php | 66 - .../get_knowledge_base.php | 68 - .../V2/KnowledgeBasesClient/get_location.php | 53 - .../list_knowledge_bases.php | 72 - .../KnowledgeBasesClient/list_locations.php | 58 - .../update_knowledge_base.php | 70 - .../V2/ParticipantsClient/analyze_content.php | 77 - .../ParticipantsClient/create_participant.php | 71 - .../V2/ParticipantsClient/get_location.php | 53 - .../V2/ParticipantsClient/get_participant.php | 72 - .../V2/ParticipantsClient/list_locations.php | 58 - .../ParticipantsClient/list_participants.php | 73 - .../streaming_analyze_content.php | 97 - .../ParticipantsClient/suggest_articles.php | 73 - .../suggest_faq_answers.php | 73 - .../suggest_smart_replies.php | 73 - .../ParticipantsClient/update_participant.php | 58 - .../create_session_entity_type.php | 140 -- .../delete_session_entity_type.php | 78 - .../SessionEntityTypesClient/get_location.php | 53 - .../get_session_entity_type.php | 80 - .../list_locations.php | 58 - .../list_session_entity_types.php | 80 - .../update_session_entity_type.php | 124 -- .../V2/SessionsClient/detect_intent.php | 100 - .../V2/SessionsClient/get_location.php | 53 - .../V2/SessionsClient/list_locations.php | 58 - .../streaming_detect_intent.php | 109 -- .../V2/VersionsClient/create_version.php | 75 - .../V2/VersionsClient/delete_version.php | 69 - .../V2/VersionsClient/get_location.php | 53 - .../samples/V2/VersionsClient/get_version.php | 71 - .../V2/VersionsClient/list_locations.php | 58 - .../V2/VersionsClient/list_versions.php | 75 - .../V2/VersionsClient/update_version.php | 62 - .../Dialogflow/v2/src/V2/AgentsClient.php | 34 - .../v2/src/V2/AnswerRecordsClient.php | 34 - .../v2/src/V2/Client/AgentsClient.php | 40 - .../v2/src/V2/Client/AnswerRecordsClient.php | 40 - .../V2/Client/BaseClient/AgentsBaseClient.php | 683 ------- .../BaseClient/AnswerRecordsBaseClient.php | 390 ---- .../Client/BaseClient/ContextsBaseClient.php | 614 ------ .../ConversationDatasetsBaseClient.php | 487 ----- .../ConversationModelsBaseClient.php | 765 -------- .../ConversationProfilesBaseClient.php | 838 -------- .../BaseClient/ConversationsBaseClient.php | 913 --------- .../Client/BaseClient/DocumentsBaseClient.php | 669 ------- .../BaseClient/EntityTypesBaseClient.php | 727 ------- .../BaseClient/EnvironmentsBaseClient.php | 623 ------ .../BaseClient/FulfillmentsBaseClient.php | 348 ---- .../Client/BaseClient/IntentsBaseClient.php | 821 -------- .../BaseClient/KnowledgeBasesBaseClient.php | 465 ----- .../BaseClient/ParticipantsBaseClient.php | 1006 ---------- .../SessionEntityTypesBaseClient.php | 613 ------ .../Client/BaseClient/SessionsBaseClient.php | 648 ------- .../Client/BaseClient/VersionsBaseClient.php | 486 ----- .../v2/src/V2/Client/ContextsClient.php | 40 - .../V2/Client/ConversationDatasetsClient.php | 40 - .../V2/Client/ConversationModelsClient.php | 40 - .../V2/Client/ConversationProfilesClient.php | 40 - .../v2/src/V2/Client/ConversationsClient.php | 40 - .../v2/src/V2/Client/DocumentsClient.php | 40 - .../v2/src/V2/Client/EntityTypesClient.php | 40 - .../v2/src/V2/Client/EnvironmentsClient.php | 40 - .../v2/src/V2/Client/FulfillmentsClient.php | 40 - .../v2/src/V2/Client/IntentsClient.php | 40 - .../v2/src/V2/Client/KnowledgeBasesClient.php | 40 - .../v2/src/V2/Client/ParticipantsClient.php | 40 - .../V2/Client/SessionEntityTypesClient.php | 40 - .../v2/src/V2/Client/SessionsClient.php | 40 - .../v2/src/V2/Client/VersionsClient.php | 40 - .../Dialogflow/v2/src/V2/ContextsClient.php | 34 - .../v2/src/V2/ConversationDatasetsClient.php | 34 - .../v2/src/V2/ConversationModelsClient.php | 34 - .../v2/src/V2/ConversationProfilesClient.php | 34 - .../v2/src/V2/ConversationsClient.php | 34 - .../Dialogflow/v2/src/V2/DocumentsClient.php | 34 - .../v2/src/V2/EntityTypesClient.php | 34 - .../v2/src/V2/EnvironmentsClient.php | 34 - .../v2/src/V2/FulfillmentsClient.php | 34 - .../v2/src/V2/Gapic/AgentsGapicClient.php | 1161 ----------- .../src/V2/Gapic/AnswerRecordsGapicClient.php | 629 ------ .../v2/src/V2/Gapic/ContextsGapicClient.php | 977 ---------- .../Gapic/ConversationDatasetsGapicClient.php | 817 -------- .../Gapic/ConversationModelsGapicClient.php | 1327 ------------- .../Gapic/ConversationProfilesGapicClient.php | 1389 ------------- .../src/V2/Gapic/ConversationsGapicClient.php | 1565 --------------- .../v2/src/V2/Gapic/DocumentsGapicClient.php | 1269 ------------ .../src/V2/Gapic/EntityTypesGapicClient.php | 1346 ------------- .../src/V2/Gapic/EnvironmentsGapicClient.php | 1054 ---------- .../src/V2/Gapic/FulfillmentsGapicClient.php | 510 ----- .../v2/src/V2/Gapic/IntentsGapicClient.php | 1441 -------------- .../V2/Gapic/KnowledgeBasesGapicClient.php | 775 -------- .../src/V2/Gapic/ParticipantsGapicClient.php | 1726 ----------------- .../Gapic/SessionEntityTypesGapicClient.php | 959 --------- .../v2/src/V2/Gapic/SessionsGapicClient.php | 1045 ---------- .../v2/src/V2/Gapic/VersionsGapicClient.php | 782 -------- .../Dialogflow/v2/src/V2/IntentsClient.php | 34 - .../v2/src/V2/KnowledgeBasesClient.php | 34 - .../v2/src/V2/ParticipantsClient.php | 34 - .../v2/src/V2/SessionEntityTypesClient.php | 34 - .../Dialogflow/v2/src/V2/SessionsClient.php | 34 - .../Dialogflow/v2/src/V2/VersionsClient.php | 34 - .../Dialogflow/v2/src/V2/gapic_metadata.json | 852 -------- .../V2/resources/agents_client_config.json | 89 - .../V2/resources/agents_descriptor_config.php | 194 -- .../resources/agents_rest_client_config.php | 250 --- .../answer_records_client_config.json | 54 - .../answer_records_descriptor_config.php | 82 - .../answer_records_rest_client_config.php | 129 -- .../V2/resources/contexts_client_config.json | 74 - .../resources/contexts_descriptor_config.php | 135 -- .../resources/contexts_rest_client_config.php | 245 --- .../conversation_datasets_client_config.json | 69 - ...onversation_datasets_descriptor_config.php | 135 -- ...nversation_datasets_rest_client_config.php | 162 -- .../conversation_models_client_config.json | 89 - .../conversation_models_descriptor_config.php | 213 -- ...conversation_models_rest_client_config.php | 240 --- .../conversation_profiles_client_config.json | 79 - ...onversation_profiles_descriptor_config.php | 169 -- ...nversation_profiles_rest_client_config.php | 220 --- .../conversations_client_config.json | 79 - .../conversations_descriptor_config.php | 169 -- .../conversations_rest_client_config.php | 214 -- .../V2/resources/documents_client_config.json | 84 - .../resources/documents_descriptor_config.php | 197 -- .../documents_rest_client_config.php | 260 --- .../resources/entity_types_client_config.json | 94 - .../entity_types_descriptor_config.php | 214 -- .../entity_types_rest_client_config.php | 271 --- .../resources/environments_client_config.json | 74 - .../environments_descriptor_config.php | 145 -- .../environments_rest_client_config.php | 205 -- .../resources/fulfillments_client_config.json | 54 - .../fulfillments_descriptor_config.php | 72 - .../fulfillments_rest_client_config.php | 129 -- .../V2/resources/intents_client_config.json | 79 - .../resources/intents_descriptor_config.php | 167 -- .../resources/intents_rest_client_config.php | 222 --- .../knowledge_bases_client_config.json | 69 - .../knowledge_bases_descriptor_config.php | 118 -- .../knowledge_bases_rest_client_config.php | 198 -- .../resources/participants_client_config.json | 109 -- .../participants_descriptor_config.php | 180 -- .../participants_rest_client_config.php | 241 --- .../session_entity_types_client_config.json | 69 - ...session_entity_types_descriptor_config.php | 123 -- ...ession_entity_types_rest_client_config.php | 220 --- .../V2/resources/sessions_client_config.json | 74 - .../resources/sessions_descriptor_config.php | 78 - .../resources/sessions_rest_client_config.php | 115 -- .../V2/resources/versions_client_config.json | 69 - .../resources/versions_descriptor_config.php | 119 -- .../resources/versions_rest_client_config.php | 182 -- .../v2/tests/Unit/V2/AgentsClientTest.php | 1012 ---------- .../tests/Unit/V2/AnswerRecordsClientTest.php | 322 --- .../tests/Unit/V2/Client/AgentsClientTest.php | 1091 ----------- .../V2/Client/AnswerRecordsClientTest.php | 377 ---- .../Unit/V2/Client/ContextsClientTest.php | 640 ------ .../Client/ConversationDatasetsClientTest.php | 813 -------- .../Client/ConversationModelsClientTest.php | 1191 ------------ .../Client/ConversationProfilesClientTest.php | 943 --------- .../V2/Client/ConversationsClientTest.php | 736 ------- .../Unit/V2/Client/DocumentsClientTest.php | 1243 ------------ .../Unit/V2/Client/EntityTypesClientTest.php | 1263 ------------ .../Unit/V2/Client/EnvironmentsClientTest.php | 670 ------- .../Unit/V2/Client/FulfillmentsClientTest.php | 371 ---- .../Unit/V2/Client/IntentsClientTest.php | 918 --------- .../V2/Client/KnowledgeBasesClientTest.php | 586 ------ .../Unit/V2/Client/ParticipantsClientTest.php | 885 --------- .../Client/SessionEntityTypesClientTest.php | 591 ------ .../Unit/V2/Client/SessionsClientTest.php | 413 ---- .../Unit/V2/Client/VersionsClientTest.php | 583 ------ .../v2/tests/Unit/V2/ContextsClientTest.php | 565 ------ .../V2/ConversationDatasetsClientTest.php | 700 ------- .../Unit/V2/ConversationModelsClientTest.php | 1064 ---------- .../V2/ConversationProfilesClientTest.php | 808 -------- .../tests/Unit/V2/ConversationsClientTest.php | 660 ------- .../v2/tests/Unit/V2/DocumentsClientTest.php | 1109 ----------- .../tests/Unit/V2/EntityTypesClientTest.php | 1129 ----------- .../tests/Unit/V2/EnvironmentsClientTest.php | 587 ------ .../tests/Unit/V2/FulfillmentsClientTest.php | 320 --- .../v2/tests/Unit/V2/IntentsClientTest.php | 805 -------- .../Unit/V2/KnowledgeBasesClientTest.php | 514 ----- .../tests/Unit/V2/ParticipantsClientTest.php | 806 -------- .../Unit/V2/SessionEntityTypesClientTest.php | 519 ----- .../v2/tests/Unit/V2/SessionsClientTest.php | 365 ---- .../v2/tests/Unit/V2/VersionsClientTest.php | 511 ----- 650 files changed, 91 insertions(+), 128360 deletions(-) delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AnswerRecord.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/AudioConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Conversation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationEvent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationModel.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationProfile.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Environment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Fulfillment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Gcs.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Participant.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Session.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/SessionEntityType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ValidationResult.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Version.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Webhook.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnnotatedMessagePart.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleAnswer.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleSuggestionModelMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AssistQueryParameters.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchCreateEntitiesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntitiesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntityTypesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteIntentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntitiesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAllContextsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteContextRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationProfileRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteDocumentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEnvironmentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryInput.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RestoreAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyModelMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SsmlVoiceGender.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/AnswerRecordsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/AgentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AgentsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AnswerRecordsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ContextsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationDatasetsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationModelsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationProfilesBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/DocumentsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EntityTypesBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EnvironmentsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/FulfillmentsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/IntentsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/KnowledgeBasesBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ParticipantsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionEntityTypesBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/VersionsBaseClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationDatasetsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationModelsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationProfilesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ConversationsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/DocumentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/EntityTypesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/EnvironmentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/FulfillmentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AgentsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/KnowledgeBasesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/ParticipantsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/SessionEntityTypesClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/SessionsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/VersionsClient.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/gapic_metadata.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AgentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AnswerRecordsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ContextsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php diff --git a/Dialogflow/metadata/V2/ConversationProfile.php b/Dialogflow/metadata/V2/ConversationProfile.php index ba3382ad786dde8543b30bdc363c7593903e9b76..25dce3071af6499a2086e99e494f268f275d061e 100644 GIT binary patch delta 140 zcmaDJ_9J}56lM;W(xSwY%>2B`iOfHkX8LW8X3=JpluOUgPtQr!FDS|{$xkXx(@%k_ z+FZ|S!NJnZ$R#rQ0-NaM^Sl;TLdIO&#i_-`Kr`Y?N^&Ha6&N+RjU@FTM(Dwe(1Tgz X#QeaKQK?acOLDTJkmP1nJ||fK$FeSq delta 53 zcmV-50LuUPSLar+lmnB`1H}ZxO$s%WKm{9-W*U>t1oX4v1u+N#PLmW4PX!`@6bc!W LF%ucHwhlraKco_O diff --git a/Dialogflow/metadata/V2/Document.php b/Dialogflow/metadata/V2/Document.php index dd51895ed380c51da7539c90f765e288611df009..8a71f2786a09619903ea09e90d0ec22623b2f90d 100644 GIT binary patch delta 43 zcmX?UbIxXiDhtbfV=m2!-kO_(SghF@XHM?p4r6qj{FK{@)rt9mBjaXy9xWjNJz)(a delta 37 tcmX?SbJAvmDhtakV=m2!-kO_(SghF@r%dkS4r8>L{FK{jvkH%v5CHJ}3#|YE diff --git a/Dialogflow/src/V2/AnswerFeedback.php b/Dialogflow/src/V2/AnswerFeedback.php index 9dcad46b8a73..d1ea171138a0 100644 --- a/Dialogflow/src/V2/AnswerFeedback.php +++ b/Dialogflow/src/V2/AnswerFeedback.php @@ -25,8 +25,8 @@ class AnswerFeedback extends \Google\Protobuf\Internal\Message /** * Indicates whether the answer/item was clicked by the human agent * or not. Default to false. - * For knowledge search, the answer record is considered to be clicked if the - * answer was copied or any URI was clicked. + * 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; */ @@ -65,8 +65,8 @@ class AnswerFeedback extends \Google\Protobuf\Internal\Message * @type bool $clicked * Indicates whether the answer/item was clicked by the human agent * or not. Default to false. - * For knowledge search, the answer record is considered to be clicked if the - * answer was copied or any URI was clicked. + * 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 @@ -141,8 +141,8 @@ public function setAgentAssistantDetailFeedback($var) /** * Indicates whether the answer/item was clicked by the human agent * or not. Default to false. - * For knowledge search, the answer record is considered to be clicked if the - * answer was copied or any URI was clicked. + * 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 @@ -155,8 +155,8 @@ public function getClicked() /** * Indicates whether the answer/item was clicked by the human agent * or not. Default to false. - * For knowledge search, the answer record is considered to be clicked if the - * answer was copied or any URI was clicked. + * 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 diff --git a/Dialogflow/src/V2/AutomatedAgentConfig.php b/Dialogflow/src/V2/AutomatedAgentConfig.php index edad6765081f..43e64096d318 100644 --- a/Dialogflow/src/V2/AutomatedAgentConfig.php +++ b/Dialogflow/src/V2/AutomatedAgentConfig.php @@ -34,6 +34,15 @@ class AutomatedAgentConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $agent = ''; + /** + * Optional. Sets Dialogflow CX session life time. + * 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]; + */ + private $session_ttl = null; /** * Constructor. @@ -56,6 +65,11 @@ class AutomatedAgentConfig extends \Google\Protobuf\Internal\Message * ID>/agents//environments/`. If environment is not specified, the default `draft` environment * is used. + * @type \Google\Protobuf\Duration $session_ttl + * Optional. Sets Dialogflow CX session life time. + * 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) { @@ -115,5 +129,47 @@ public function setAgent($var) return $this; } + /** + * Optional. Sets Dialogflow CX session life time. + * 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. Sets Dialogflow CX session life time. + * 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/Dialogflow/src/V2/Document.php b/Dialogflow/src/V2/Document.php index 1dc866aa8207..98e57e078a99 100644 --- a/Dialogflow/src/V2/Document.php +++ b/Dialogflow/src/V2/Document.php @@ -58,7 +58,7 @@ class Document extends \Google\Protobuf\Internal\Message * 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. PERMISION_DENIED), the + * 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. @@ -130,7 +130,7 @@ class Document extends \Google\Protobuf\Internal\Message * 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. PERMISION_DENIED), the + * 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. @@ -350,7 +350,7 @@ public function setRawContent($var) * 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. PERMISION_DENIED), the + * 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. @@ -373,7 +373,7 @@ public function getEnableAutoReload() * 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. PERMISION_DENIED), the + * 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. diff --git a/Dialogflow/src/V2/Gapic/ConversationsGapicClient.php b/Dialogflow/src/V2/Gapic/ConversationsGapicClient.php index 3958336cc9f9..ddeca1b22363 100644 --- a/Dialogflow/src/V2/Gapic/ConversationsGapicClient.php +++ b/Dialogflow/src/V2/Gapic/ConversationsGapicClient.php @@ -1410,7 +1410,7 @@ public function listMessages($parent, array $optionalArgs = []) * [latest_message] to use as context when compiling the * suggestion. By default 500 and at most 1000. * @type AssistQueryParameters $assistQueryParams - * Parameters for a human assist query. + * Parameters for a human assist query. Only used for POC/demo purpose. * @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 diff --git a/Dialogflow/src/V2/Gapic/DocumentsGapicClient.php b/Dialogflow/src/V2/Gapic/DocumentsGapicClient.php index 59dd89a28be0..319730de742c 100644 --- a/Dialogflow/src/V2/Gapic/DocumentsGapicClient.php +++ b/Dialogflow/src/V2/Gapic/DocumentsGapicClient.php @@ -829,7 +829,7 @@ public function getDocument($name, array $optionalArgs = []) * Optional. * * @type GcsSources $gcsSource - * The Google Cloud Storage location for the documents. + * Optional. The Google Cloud Storage location for the documents. * The path can include a wildcard. * * These URIs may have the forms diff --git a/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php b/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php index 72a0b61ecd2f..b363c38a0ae9 100644 --- a/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php +++ b/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php @@ -36,7 +36,8 @@ class SuggestionQueryConfig extends \Google\Protobuf\Internal\Message * 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. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. * * Generated from protobuf field float confidence_threshold = 5; */ @@ -81,7 +82,8 @@ class SuggestionQueryConfig extends \Google\Protobuf\Internal\Message * 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. + * 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. @@ -231,7 +233,8 @@ public function setMaxResults($var) * 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. + * 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 @@ -255,7 +258,8 @@ public function getConfidenceThreshold() * 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. + * 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 diff --git a/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php b/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php index 6ef6ed220a96..4d01867a0b2e 100644 --- a/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php +++ b/Dialogflow/src/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php @@ -18,7 +18,7 @@ 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. * @@ -34,7 +34,7 @@ class DialogflowQuerySource extends \Google\Protobuf\Internal\Message * * @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. * } @@ -46,7 +46,7 @@ public function __construct($data = NULL) { /** * 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. * @@ -60,7 +60,7 @@ public function getAgent() /** * 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. * diff --git a/Dialogflow/src/V2/ImportDocumentsRequest.php b/Dialogflow/src/V2/ImportDocumentsRequest.php index f675acdde64a..f8ed0511823e 100644 --- a/Dialogflow/src/V2/ImportDocumentsRequest.php +++ b/Dialogflow/src/V2/ImportDocumentsRequest.php @@ -50,7 +50,7 @@ class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message * Format: `projects//locations//knowledgeBases/`. * @type \Google\Cloud\Dialogflow\V2\GcsSources $gcs_source - * The Google Cloud Storage location for the documents. + * Optional. The Google Cloud Storage location for the documents. * The path can include a wildcard. * These URIs may have the forms * `gs:///`. @@ -98,13 +98,13 @@ public function setParent($var) } /** - * The Google Cloud Storage location for the documents. + * 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; + * 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() @@ -118,13 +118,13 @@ public function hasGcsSource() } /** - * The Google Cloud Storage location for the documents. + * 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; + * 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 */ diff --git a/Dialogflow/src/V2/SuggestConversationSummaryRequest.php b/Dialogflow/src/V2/SuggestConversationSummaryRequest.php index a8bee974974b..f791a7d5277d 100644 --- a/Dialogflow/src/V2/SuggestConversationSummaryRequest.php +++ b/Dialogflow/src/V2/SuggestConversationSummaryRequest.php @@ -43,7 +43,7 @@ class SuggestConversationSummaryRequest extends \Google\Protobuf\Internal\Messag */ private $context_size = 0; /** - * Parameters for a human assist query. + * 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; */ @@ -86,7 +86,7 @@ public static function build(string $conversation): self * [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 - * Parameters for a human assist query. + * Parameters for a human assist query. Only used for POC/demo purpose. * } */ public function __construct($data = NULL) { @@ -189,7 +189,7 @@ public function setContextSize($var) } /** - * Parameters for a human assist query. + * 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; * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null @@ -210,7 +210,7 @@ public function clearAssistQueryParams() } /** - * Parameters for a human assist query. + * 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; * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var 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 deleted file mode 100644 index 8801329edf7f6c5a32d59c63399cb53923aab95d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5894 zcmb_gOLN=S6*eeKv5#y^zVd^nlLm(ESbhkMnMYeXP6rezi5)#S6r&ldoT4CjNg@FO z1OVmNxQkBv3$kgu$xLUm$ugVHblGKAopzV$qKmG&>#ChLi=2D$AVfnH<;WXTxaXXE z9^d)Sz4wEkI6Vihi>uV4uIAIW*m^4ZJt{h`?c2I-imgGXLtRm~`;K8!R~E(cmbkgq z5G&r%^?xk&&^>r>CsbSkda zN*mPI+M2I5SGjg`nQ1r6v37H(@BlzJHO~_jW(A&ui2s~H%QSS+^EDs;yJ2{$VHrNE z8P70=hhj%FJ&Kwy%XS8q?i;oxGKDQmr;E46z$TNu;n*1SLoxEF#?pW(XjUzsx|U`( z%hc0d!|`pmhN8t{m-=z?*q6oI;kL}2(GeE|AB)A8oO~$y?tmtD7e$x)1J`=M{bmMU z#J`#;*-{*%saTfHvS3?Yu{exrXyPEnWz)cX9!+P(pk}*7d)l61yGK*4(-0^VJDGxo z<_=aE@q*E!y@7cI_t$N!>kcf-u)57Hhk^ZQDT|SSb*S_m|LNr6$ErMi8=CjYE9h<` zSo8zp<)~fy&ggtsQ^R+0Cu&d?0Lhf>CLvsx5 zdIqMT#dB{a7CH)$d_Kd$!rm0$R;P+s$G^ z)jjHZ%>8qGzk7%8hh(}F=md6t3@3eqy4g8y;H|?AG*FtWN;_~m_MYV6(uUGlUQ;)= z$`$pa&Fxxcxw=xVl;=;7i*P=%w)Uu0ua@UoWk}-l#=5$-x&CNABbfk0FUeK7tkkON zPNlwG-P#%uWnaxgV*80$Vaud{?YdQR4#K$DE9xQd<<_Ucx9v` zf~Lx1U$VyV^3TIxFM=}#SxQ+k?EoGq9sLZ&rJuswD)qV1I{kD&J)it=q+y%4c*kBN zhj}Ia66Ur?jJ*fb*pOlK&lav73L1u&40#u32M&%ksxrpm?LJ$`Mamc=KZD5e_y|z8 z0i;Y#>eFM2=NT+)Q_a=7=#Ys|%EH!7*C%&54gA=H<4(A)LW?09RFAAjcgt6@L*kkG9p>lE^ zQa-x9uy3C*GYd&^K5W)bVC-iD8@i2$0R$qmb7t*C2?rEkkbW%ysrHZ2?R|c5x6}M! z<7uBCzY$=ejtywL$An*`pV9nH=iuxC6Iv*Ic^+msYCQ5s0Zv7n zM8=NANGfzKcR0I9Kl|0+{`pyEoxH(rVb6nu$-|g3?}W6tdzai!7sy8h>g6NhZ_CM1Y;F{VJG<|O7<)-FEtE(r4(4km4;OY(|G{=m%(C&hNeE7u zo8L~D8-tJ2Bj+Yodj(YdAA3GIJ;(QaQgXuBe;>r&l5VDVZq(s;0b?Va1^>QuKV3Gh zHHLbx5dFXL?2t0E$@}Agm7);kV(jg3^kg6fqsbz2dbD9?^265(Oh4Y&cRwJ-bd8k! zyri9b^0jj1zCaFbnasf;RAb!Mp4dzA5+}+wI>wOnkUi=`#U- zfUgr{a$5p^n5nUgN=?}PFzD-$(AdL9*G|3&qhoj+8Sdb;9wh(xuOR#(lPRx!naQp4 tS7CXXy$Z|a_*GcmDYRzzh<)c){I+#3cuq~cz8?7U$|Zvr(iiXo;5%^ez9j$v 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 deleted file mode 100644 index 6c00b5c31b58d5265337daaff09f3bfa2b2fafc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4426 zcmbtYOLNm!6h;mS_#`AmKuA1o5e7^A;MR%Qc({t~YWch(fXg0BQ@A=NT=X~dJ z_0b(`+ky+y3NeVSxTGP~pGfXDku2MEP1V$;dZ*bWwxpVEOVf#+kfhu_sdR5c%IAt3 z=TX!#JGM&FQp+@3I!UU!*=ZyjnxdPnrf%*fcT-8laQ28@vx#cjjRb=RFqAfNEJY>K zN;z|vxJpBDmFfyZsb(okH5Z^%w^GXhs;)SWBr~)M1A}KE;h)v1>zXP#uHxdqi<(o@ z49!Jp?I|AVmef>qhakY<-e$*8UClHkDsazG$>J4>W754BEfZaEOY+SsQ?H;$szt*k zwxQ_N9C1`zvs}|II@dLu)&m0iuW4<}k79&Zk8 zs~ZPzw_grevSY?1xwmvcFr0fgwszhPOR*$5=6aJ9D72y3)bhr~SFirwXYO?2i*U=T95!H2)&%9szUg_kp z_})7)H*a6e50TJKmFIu*ng8<*Fqz{p!4c!n1(;t$AB634D&$cI$u8c82@EtImq#Fz zKh8`cM{u9Kr0PMYM?hu28 zBFYxxyRb0CM#sXMN5qd|y2nWl8asxpSR5I|P)k9*GX{C=)1z6a$uuYM$ zdwlQY;6#sN=A=XD7tb}`l{g!n0(>ra*jHg8R@^`&8Iq?Vqn@r_1%=Ec2{@Vo1$wU1lDsVF38b(&Zxy6fZ=I~zkLS7*r63;#j zPB%=o)24MXL?p(@=~Uq@)Z{$4kY~B77Mu!Hk!BMcIx*BIEdJA}{QuCD55TyhHq1Gl zc3ZKvr>sPFDa#A}>Raeq4+Hu{X6j;J2ykZTG9@+k8QbN2r2T9%HHy?pm~=Yzw&n@& zJ~v9>G)(c6KB>7_%a|{t@lRmJuUuZNMG4-KOY8UZm0Bf_l$J}`d>^T&0g6a_wzz?u zo`U1SQzU*LP7R5xcoFcLklnnSF9qqqvZgm*PC&F+>SoI%9P=L{@dqIKz}+y47vNlg zn=cfK*?5h8FgAM?0Gmx*LbFR zrRT~>iqL6P_qqe+01g4zkf5nN@=5&n1TiTaj`*hl zvjfdgyg3SgV7u4BVjmt-ig(=j&gZ}W{$-?E6)(}d-ZMTT+zKX>t9{eQ!yDoU!#5`V zdBsWg3%!)R(L?+(0^(p37Dw7XxZgkWfv1A_&jLHFrvz|x9zthsWG<4*?vF+-9 zx_35sSWewJ07}RoZ$f-2FZ5Wn6q+JpkAIODUOR)nkRNQjuH~eY$-TWjj{?Dfs&w3K zey6{NJ=JZRc6;ef+qKEdXx8<&II*b={khpz0ey{@yJ L{93&a`vCs|Jr2>( 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 deleted file mode 100644 index 55e0f79adaa37ea13751f357bde46ad795db9962..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3603 zcmb7HPjlN;5JyhaHk;U0)l%FPTGg~e8mJA1=^>>pvZXj4Y|CTI2{4(_$kMYdkoANl z2MUvqz=h!xaOBF38()C~XU+^CfEh0Ad$N_paSipw@6YbO-QWIp_1=fif>8i($~EGX z(29v8_n*u0h{!=mV`@`R?oS2-63R9m2d+oLqAaVr+|mtMQ|rcERE_8)w8@SlimKPD! zKQB9&_;&14UuFurZ5CZTV6hboEe&<$c5wo!Cv zXGr1{Nw%`}V0tVw=MLnp#K)bTb51^y<8VSwpDxQGi6^1|nETBP9H*nh1(+#;d${Wo z[+b>z};XXhlU6C*ED?T~3A|F>2OhdM#(Ac~6*P|6J94Ccn7a6sc2E{^r z3x2r)4_}H((q1aP#(bi}Mk)T5_ggB>RODWV-<& z_6WHaldogx3S0_Cp%sxRFUTufYf=_g`;R?Xa{dB$ z>em$z>wYkaPnC_NKrSgs6r_&p54kJ3@`ITx3!p4=1KLzUx(Qb!YaDpQWNpJ7kud&- zFlRAB(u_o-`>F7XI&S8Xe_#t~x|>!Lh)Ytl!s9z|o%93o{%$a9e^ zzr8dp6z7JqAW^08vj8``&wXtF5qg@Uh)tX26eF>|z>s;u`I!Q%fWVFI5kF0kZb0sc zdXq6RhnDM`PM@bXUem;*A$jytK^zDKj&oS62Q|GRxR*Kt4(_o28qV;gCnaUM?>?axvb89$Ygp+rfzX z&((N5&=_eV=_#x`I7>K`w4wi~+A~%PUxJjR)u0Ae6LvP1+y-2q()4U)u>SP&m66sP z>sM>r{|Jyh+d6K;rqWaEx~a9Qx>|45%wDV8)~fa0x~7V+NUuYFZog4)X-da@?~y1- zufess-Q9*#6*E|o*XK5xy@qlit{^R?xgDk15iej?Up>EW9#q6t=@z^;x24x=rrz## z#f#DdxIedv?rWcz2X$l5+|v|Q>zI{K4NbhXeKZ67O!K%0GSjH;nN3~Q8s@&zsVgmG z4hM9**VW95)-_CJU#T~gN<%{gMA%^KT|;T9N=L=erz=`(Pia*V!YTi()L zc%$2G;%R!ls+l#d#r!-A{U$bmb0STJAB$-@zqhOL-Hh}G+&sVA(t1WmX`nxU32<#e zbxHT(uHG}+J&bS}CEkQPi^Wbe16^1w)NH?xAieM?+%_M5V18U_caanYxV_j)N`MvV z4%}KSlQ3>|`-co<&s3g-q&KvN*51=wpPH)C+?_*y11|Gby~R>In;8c>dY%K|d&XWz z(~!?uSmX0uy~k*rPV4&`Qg^1?t$%`Co#}S9eXS*4O6OX=wr7Z!Q{@(xn8>a)iRsU@ zjxGXTC@%7o6mdNrSHz8UTotqFSQT@rI&!lkUP%vY>%EpLik06pa2p>IOZs6&Jatdu z7tFTs+0*1YGP~x{acM|TzcBD}hmVYti(k-xe0uV?ApDrgsJlO9Hf#KOQRL5y;>q)( zxL^KL>A@}j5%#9;q1C8}-j;ajN{{f%^*Q^5mA;*hj!Pc3`F9%EX2atW@1eND|BwGv z`fw-duJd-={4&`kvGnZ!+D@)XsKUJ9>Ly+!kNX$VKuq6%E4@pinternalAddGeneratedFile( - ' -" -(google/cloud/dialogflow/v2/context.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/struct.proto" -Context -name ( BàA -lifespan_count (BàA0 - -parameters ( 2.google.protobuf.StructBàA:¡êA -!dialogflow.googleapis.com/Context>projects/{project}/agent/sessions/{session}/contexts/{context}fprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}Sprojects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}{projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}" -ListContextsRequest9 -parent ( B)àAúA#!dialogflow.googleapis.com/Context - page_size (BàA - -page_token ( BàA"f -ListContextsResponse5 -contexts ( 2#.google.cloud.dialogflow.v2.Context -next_page_token ( "L -GetContextRequest7 -name ( B)àAúA# -!dialogflow.googleapis.com/Context"Œ -CreateContextRequest9 -parent ( B)àAúA#!dialogflow.googleapis.com/Context9 -context ( 2#.google.cloud.dialogflow.v2.ContextBàA"‡ -UpdateContextRequest9 -context ( 2#.google.cloud.dialogflow.v2.ContextBàA4 - update_mask ( 2.google.protobuf.FieldMaskBàA"O -DeleteContextRequest7 -name ( B)àAúA# -!dialogflow.googleapis.com/Context"U -DeleteAllContextsRequest9 -parent ( B)àAúA#!dialogflow.googleapis.com/Context2è -Contextsœ - ListContexts/.google.cloud.dialogflow.v2.ListContextsRequest0.google.cloud.dialogflow.v2.ListContextsResponse"¨‚Ó䓘1/v2/{parent=projects/*/agent/sessions/*}/contextsZJH/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZVT/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contextsÚAparent‰ - -GetContext-.google.cloud.dialogflow.v2.GetContextRequest#.google.cloud.dialogflow.v2.Context"¦‚Ó䓘1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJH/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZVT/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}ÚAname½ - CreateContext0.google.cloud.dialogflow.v2.CreateContextRequest#.google.cloud.dialogflow.v2.Context"Ô‚Ó䓼"1/v2/{parent=projects/*/agent/sessions/*}/contexts:contextZS"H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts:contextZH"=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts:contextZ_"T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts:contextÚAparent,contextâ - UpdateContext0.google.cloud.dialogflow.v2.UpdateContextRequest#.google.cloud.dialogflow.v2.Context"ù‚Óä“Ü29/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:contextZ[2P/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}:contextZP2E/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}:contextZg2\\/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}:contextÚAcontext,update_mask‚ - DeleteContext0.google.cloud.dialogflow.v2.DeleteContextRequest.google.protobuf.Empty"¦‚Ó䓘*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/*}ÚAnameŒ -DeleteAllContexts4.google.cloud.dialogflow.v2.DeleteAllContextsRequest.google.protobuf.Empty"¨‚Ó䓘*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ÚAparentxÊAdialogflow.googleapis.comÒAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB• -com.google.cloud.dialogflow.v2B ContextProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' - , 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 deleted file mode 100644 index e5db6c1c3a2637ad69a8e22d239f96ff9f3e718a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6974 zcmcIpO>7%k9cP>--MoCYFIAg((RMmrcGJ?1x6W38+oYPl zfBpWy|A*f^edZl_=&rm%9O4@xsmXiCa(F;w&v!%DbZvRBS+5gcHrOS0W|VJXKOHw3JkLvQH2)Z6gTeyr2xdL^Aw&%{|*P=PA-&Da#>r=G{XqsnLHOFx&3a%66a%VA}spuz|w=Lp?7n51Gh+SJE2gaf0`WF-3 zBAhk@JK2L0Rgnsin>rA5a5s7>EEzs9$nuPfK+$4F#R5u)M#JmvM8u|tix%gOR;#tB zvJ9TjwUSFy{VqCH(ZdVX6i&0_YE**iSqZ9#+4L>0%J3{GQJQO3i0RwHgE~#9zQ;4l z56lV&e4aM`=rMm38BC~o9crE?hl@Q(5cAG5(BUBHh>9;0#xS!3%BLe}Tx0^ij;_$| zG9$^--00HK7upcsMpL#`C+4wf6P?x|nMuLZ$?P{&=1ecpR8gzC7R#5ZI8$3jH%y@& z#c|FIMV23bp`~7F8T3#{1+xZO2vlgP8PNh~Fy27p-ht~7-Dx)Vh(B`$l#ONQ2X(YW zWj7*G=Hxs=5V0TX6u6n;NLxDA7Ne@R$jgKtp*M(AVWU1_l`2Co@+;cru%d z?e*YhJIo>?fb>35K0uT0*yG#i&9&9#V*bPYT2U`ov`SIm-YA!f`PJpsV&U3X@Dv(b z-Ox*0n=4zza`~EsC(vkqbG@`ytibb>a)7RP*})2WE5Et1Q`{qp$WqYj)<@O#B}|*AAkLo zHkZ^&v`A(v5=qaa>)ndS(9m;o%)^>M!-t05WQ}(;m-?op{CNo7j#uYs8MC4OI+z}! zo3MX`gg(;6{>rnwnFPx@%GGuFWz{fju}s;J+Um0p(#(%#Gf6f@WhJ&QGo4?y+GfzT zhVg=8!017TSX6Q8kD=A}2nFXZ)zO%@XKk9XowsRpC*DK?4nk`MUgO(}@{=JX_eY+W z>vm_k7Lq_cPu>5ySpOjPE7nG5v8JM8-FY3sbeHO-$}Ic)YiL4bWq?0UA>6$t;>Sr| zcc16OC_V6oqx@X@@t^+wv(yXaYxFkhC0j-pTAT0vj_o$rwr=if%A?+5nHDEA$tq5@ zX=d{QR8i|D3;$C>*Sq#Q{C*M|UB_cE5;5!{#mYf>9syIW;=z#FoyQl);#A}7KR%Vv zRL4e%vq|B09FBt>Jo8q2eDr6%koS(CM)yxz@pT>)GTkL~szuiY_`edm(QB{8=iCwW z-Gnc|@Q)b7Lq(0K+UdSXy8y_Vqt~%?|ISJGcb_S_oiLF0>19{_?ne{9d0D?TkDV@7lYI_-P-Rq`+J9XRQ8L3Z?t+b$B5usQz*>CX1I9 z=Lr3UG2>H7sYKz5fFzYdCSbn?qN`y3IWKfCzAsS%5#{@dsuS@X*vzTc)|T<#QfQ{% ze8x|bQ0pfZL;mz~!W{6=7~r2sN;yKM_Zq487(yZx`}~DU=YC4@t||J3G`G*G0j;E8 ze6G#*{cZe5?ZbmG^nzR_b98jX@oKGPMl(EMFLEAw@Jp}m`i%$Y9X~U*^h*i71q~`8 z3rlU+Z?Nu$Zb{l*WS4{Sg)Cf;?z`fxGWZAM|ICoL_eA{XKa%vDRI0H2yHt85dX1#! w>1!ml(0Yxe?qv5yU~LH9`FC5l?GM95UJCC05ty4u>(LM3pTBJXY+B9&&9hDubHR*rXe=3s+Qx#EfU`b+Yzm7YaE!JMX=D?|bii zZ)R@1;ca-}vbcmC%F7idw-SjLQ`LZZBSH!z3YvQfu z^4d#8HE=`UM5@?x-JXpU({{s-(yS)8*vRr>M)m6l+ zXly4lDnnl~Cy4Tn>-7B4aV)2&uXwchCqpSoK7sz$riXXNk2q0Xvq~>QLknmQ{5cD*|0CkUGE6rnSy3D2QL3$N8NiP?=$c3U7 zL_Oi@e&4O7b^?omEzQLQ%)Sm-WOjG)y z2+pMa;LQ=92FGZ#9e7ZLGvH*$3Ow7`X-7+i*tr5Mf$0wKW`r1}V!R^2SHZODBQh-7 z6q(X7vNByO$BxFZ$w_h3V2iL0PFgfrf&z`UbUaei=VHB#I+9c9Fe7)sX`()uB^H6W zG!j76?YbPl-GVS}wNeJlX65uu*3qO^?rc4N=^o0Os z?^r?BK0&Ar-2Ia0sztP*nJnJNf6~D-?zXc6Bog| z;9M5;0ZC8sA7D?sdBH)Ca69Ev#8{~Z#3r&4M*nq6z7fEs50McVk8oqS&$;_?vAE=N4epo)9)`3#Vp4XNBz80OU;HL#p${PuAVH5&+S}_JA zD=uG|kzd+50LV~9Wmi!G$dLTe6}YeQV+edqh?Gmn(L~Bsi$OVpNS`nwsg-}5*FCKP z&hb-ta=49dd~kwh1Ai}o^V!2_G&{0&#suLB1K~?SYD~fgm9_T6y-^h^57wlWOiN?% zB;V?uwtDoaPKMdoL%sZHPn*d-yZ@-Yvw^V}sEV?^z0K*F9PEt{Z?LzlYvg)_yRN@k zJxYAARsAagyh!c`BS>E_9fp@YinZvAQcHMnll95??nf>fJvaTPM%*ORVX&XKzL5Us z4?+04P-x!%woqP*9@69neMpm=$wQiazqURVRr4!z$&)~py*Z_xsOa_9GBcj1B1!g) J)CYY4{svrVCXN6A 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 deleted file mode 100644 index 706dd9507cb4608df505c984a43f23f8f49b1be5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1358 zcmbVMO>fgc6s*$})NKX9Ei|nJTG~oYC2*wlmeN8#HmN1zM7A3QvSe+XO=`*YTI+SH zf_mUzATCH8`Gp)=+xbEX2$56l-I+IUJny}F9b5(A05*wF80Mr8d$*8Z5g0JasY5;3 ziv|P2phK?%*CR}Uu-=AR+k~jDn$HC^q!DvS84f8OdZg%hH0l@oF81hf;L)4ns8n>Q zKO!u|+@-!vM#Sez!ViFtuSpnShrnj1+9DkHF~?Rjp|WZ*l~tcoS>4hp0FH;l5Z2}> zQOpQF0VsY!)bm^ihFlbL;GrAZuJ3X|;eHg&oxuV2LLyie?+zm0i3P$K(DoftIEE=_ zeD^S*!i+OG(bkFm5#Cs;&k6IfXVppQFgM_ob;Q+jc}V!w)%Z=}cw9E7a|f`HYAlx* zM4my;A~IhcLPmJR{L@5tOmH{-XZ@RVRtGa-i5p;_m&>yrXOzo`^uVzU;bjyq$0WAA zJa@+?RQmmC&kYfm!c=9f`3QVj11JBH6L~KMDM`4LS-6x@X>Vst$O5MrTN;IFxb{D< zf=3H6k+;F-d>r!rvd#XA{7|1hAx4rIkW1R`$P2Ae)rk208P62icdJ z(Lpt}p`vr&HEtu5+Qs&A2vbiJ+Tvek8Pf812{ zn*^ST)$y06s!tXSO=hbjeK=1&n0yO*T^!Q+&4L40ESFgtg5K%;!%s>2p2^f3KQepG tWT7a@LQ!T5Md_A$_mWL?ax_iqi*)+thBf}8uCruNlbh)P-GMs*egUn#v^f9( 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 deleted file mode 100644 index cad9696714f6926f6a968c1830490f198145ff42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9183 zcmcgyO>7%k9p7=jnwPelzHXD$Rl{_)t7b!MgG<@P-E0|uBzWaG*~F=oVreuPKRW~C znPFy}G+PCsmEgGI-YbBZ|0px=DrDD=hu*qEZISAe(#8P_7QJdhGQs(#_#nz9c1x}(KA&ISvj7s zZ19bZCSR@8nzt~iZS*Y#75T1VbTyP$G^5|nw^dm)x*g3p%pVl;ilHAM%a$G0(50Ty zMp};Y2SAs5$TnpK@oSrzrx*^ygolvS%tShXrXtJdSfLjV*_wr#!~V!2K@f@gro ze`bGAQx)EJurP(ct=f{Rs}5$Net?Zz;XATsBg`ebx6{`Zq99KQHgp9oy~#74WbbX$ zz+kNKo^G22AB;__raQ>eWvx{~wqmKKV_2JbYq8ixj*lw&W$8^rx`o^bIL+@IBU03yPYr`aQJDQQc?=W)Jp6MK&U16WJsp7zOfyQ&);V!Q3f!YWRqCEt6*mv_KNUk3Njkv}lYh;lUPazWDN4hq?Mm!WK`I4Oxs zS<+=c6I$pHze#(pH_;r&Ig&>N-OgiD!37%zuu3`Ke}rlbJ^~j=<*|`tFO2hJm}JQ#iNQ8k)6Kq9VFXO<8kivYj25P_ zz{`dEY19$xa@&NIX>tu*(qz5cm%B((aA8}xN-ge!Te5{qnua91-|gbq^J}TpbL-~9 z1!` zIPlp}lCqe@`Dy2Hd(B6}0&d_W`5ICjJO9l6bez`=h1I+KGw@V*q<(k!^#BaPM%2H_9m;6_C0>Vd5FsfK6GSq|30737oQsMkAccVUu-+TFBZ z4rF09Fb&Bd?wl3ieQ@^6jzcE+at!xln0f(+w|XDX9D9k9 zO4DEpS1^LM@WXL18yLo%da5>$ou@W`6~M4--S{FsW2Uf@=Gj42a)GOvZrI5Zc#Sb9 z6S85GqD{khoU(s3I{Px?;|a(ffZ0K@uneHA;o(|SZAWSwO23EOJL`?5)}0sPZ6G9v zQpMd5Z-UvL{1g{@yRSJ|?>^>1P??}DE&CKeD)^K_{}<7vd2o%@8rwvQ+EEo3RpBwX z81B7r6->E(+qM1yo&jEnd2lb;evGVt8gYBL@C+=bcShV7uR4~D=V-m_Hbn=w3_4$2 zF1(fI=CC|kU~}|8={U4t2@aSKJWSWTew-wg)W(;U`Z0%_aL}t+2I3YLiY&#zK;c1z zVw-`R;F4pQ5S>iJ6`TXpCYcOve4Gt(m4ovD(BB>7>qw_T zNjnQCd>dnvB*!-K*$~0^z*Qye1d4@?u_j~iXkcJHUe(c4M+zxJXLI2`SgaroIVfVV zXKxHfl*rVKqfv++0Debr(tvj(G2h{ i3!OT#6)4wk@T z)WLKhVS}3I>(Q!MU|X`+|AN&_$jpG;19p8N;8$oVe+!;-DpJ7BRIA-=Kd;d&i$BgJ z8tC6l_{Ds%+OeX;PPDt;`H`f{<-&VuH8lazh(LC%g!vIq#DYEKm=-!fapY9Cy;Ck% zs}*`k3l3UiWT`AR%GEkKca4+tocq;3p*6R}T7!I>6b`{sB|d2*c17Ao7|4;WJp#*# z_2N?&O>K@Xil4IJPcop85Jf>=Ms;{&SW2;2j*oLP5KlwpbeuQO5$7oyo;TvVLn3|_ zkDZNLvnJMSPe{0OSsL=?fb!HaMD zzyso5d&a)=YYJHGG(8NkSfVom_B#gH2g2uRT^S7gaA8;{w~{ymj*D#SFLKLIO2SGk z-Oz*yc%-8jYg@G1{5}J&Cr%ge9j`pcJ!42DJ0pT848d;-_hXTWN3idnoCt;$;ZZE* za129SPQ-Fj4308({UQSv<7#j)3qUaq%ye20(bN_YY1@Hp;kyj$4>|aDEM#$DpSlpm zHGUOVVrhrLJ;2AS_`l5nKDGo0YTK}!hS@M`54Fn6F>(9B_Xi-1*7!IOkHgmc5JqW- zfq05f&@KL)0k;xHtN=!s3cyfu55^%K#7*a#z@p?OO~m>AT)fSg#7tSC%YhT|{q(0i z=Qv1YpPq=<6EA50DDLh%j%gS3`NP9QH@N(#WOCoxXD^xDBac!#hSj?}Yd!LS zHTs52u1wx=$yNL}Tyl>Kdy{zlc8vRX{8t3-ve!XEZ;y~C&8iaf<_O)%-tagE#{m2n DY-(pv 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 deleted file mode 100644 index 25dce3071af6499a2086e99e494f268f275d061e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11256 zcmeHNPi!1l8E4mVYk!U%=f#fKo21=rTIEme-LjzwoVsD`wH*`xtJnRLU^E)fzFki; zo*8Cl?K;5{6i#pe2?>b{LZDs{H;xFwp+Z%}32r%Y;DExRy@4u__}-tHowaAS>y?o> zkV9VTc8$oHJ?^yqa5C-N?IwOBPY)2`P{d#|`#D(beiOI=U% z4ck(Ya}7BaxC8)8+o7JL=`^>nHnU89t*ZIj<^pH7Im?)BmP2NnZwBNO8h8aSP+X{JY!&(XEDhNUwlbBtis(&@G9 zIl+^yeaW%WA=9})JCy3%=%39+%criTnVV(m>8|1Uw!4N)r>5%E4?WACT)QsCGImBS zcTMOxHFZSE>74I2XjFPG=Tg7nTDQ2~jKM+p+h&aK6vx<9EX!tIuq|(Ds%cY`MH1nx zX;8~Q9?iT#&FT!@)^-isJs#;gl_=_1$rxm8DvhdPBP?o0y>sz#jMg+4kz+X8aa^!u zTXnZ#S%y{LTy@xPI-c7@G?g2IwsRXoQiQ?Wj^polLCT}Ita%T+pxrQV5Bu7V6Hm+c z&Ey+~+$Bo28g7bt%mmj$7&A~`g`cdzYh5K1k`-hHo`VX_98}mXWyd5-%`q@XF?5Rz zlzlPsqQ)SsZb=Nw1>=zgt^}%lH7Q?lfrpZw#?Yu@>O(ln zaEfL2Oe&YU)=$Rabk*=2Q`=Yh(=>ZJ)AJW4O}+pFx=XS2sEl=H0N)IhvIU{G5P~VT z5JHSm^)RZ2gOx&3o$ick4bE!~-`-(`PSxs&0U4i64`=XdAT|a-1tp+V7@zMWe&7S9cuD9c}Bq$_{ufxk0-BU4% zco-Fx?y|_lY1r45hBE-3ABMXBvw2h;O7-mxdxO3g1bP$(P0gw|n0~rlr5Qjr{p2k4 zGuWz+Y>Q@w_@gB_>ruVo8vefOQQt?$c$q==YUcBwDg~H`jphpmpVLb!P9qtr9y!xT)m5q`9vB5&Zne?WELD?XOL z9keuaYohPM*9f5_E#3jC#L%0zKpheVzaEQe{s$>|aS68>S{8~76j`U=XkaNKbMPD{ zRD_X8Kr^pls`*qYl4IJB;dNNVnL9HqY4s8Uz#sYcLu&E7(Vzc*3UbLBc@DN;l&rvL zoRd7%um@9Kv0YGOOeJG*#zK6m5p8%{%~#>l0*&)d;GEfLZVp^?OlahPi#E^l#2uqt zAnAm{unr?}uHz9ozUO$|$^Q!Ve~XupHu@(CW>u|A!I9F%>a4WkXu%8nF`;f9a%E~# zpSIEVMB@6L6pX}{x-UX6ZiR41ZC>SD>N32ToKh6Fp4@~14>LPaF_veb?TaK{Y6 z4^f4n?Pd0+^4}hT@#M;wP{0`e2TI2+U^{RrT4udQy^bk_sf(b)=1pomA7~uc93-k* zsD$h=a>$K5fGoADYQv+hdQ_HZ7*0x-31dM~)$n|}kKIXNlxQFBc4ySGsMLz&DJ;w0 zf$^rb8?J$Vbi+b60;ero^>#GV^fmJ#&&z!T%c^ae`)c43z8(6qe>??aO;+>R9yVNt zeCEGJAQ89K#Jh|zXR@6+M;MZq;S#m9Ei-62wlohL!zOng`99*qh2}HW7lt)!JL?1n zN~`TecLI;Y4%6T?)-rcL2$<;3x(ry;_BR<%=}HI2^+*v_cd)TB19_s0Tkg&*6cEWdx@6PAQw^A@#we`jhYtUQt5UE!^Nj=I^P^${xO~F{R;9l6kl=&&a^^J^rrnYMPBN!!{*hd=cSXw zvr7xt>;{~R2_Kn;{s2A!?;D)=OOQ`y9dOF7!e}`z9;DmeB)bcvv3??#5a_P$sKKFI zmQkj4>RKPU0vGt}UBmSonkkR};Ucyh`f%!TmM=1P-Qa91H~h>{kle*K&OU-M)FU=! z-iBVDm$~HrnO8qmCgGK2XB}ZfUV!r~Z;eomek3JU8=L~ z?%{t7*DP5#unlB3_GULXVKlZIAUVhc#ntlJVHm;aYJ9vdsyw+2<8lS#jmKz|60|8I zG3Gz)fw5-sY@K3k0WpnTs^Un@Yc^}5H7|FT16mjsmXO;TXNLa3Rs$1W11@@+Nxhnl z-#An*jyJ(U!4he&!-~-=trGHOa(Sy9h|LyZ_^>kM0t{(7cfD#gcDAT10l}tdSu7Ld zi3~9>ow41zW*LvfyvL|UXh{|ZtJE>=eI5XO$BdHGx%1G!)$o0EFFt4KRX#_K*s?h` z&UDo(4%7^br$F&`<_ru9FJX_nYv?rpyA+U^(a|9E`nF@}LL0IHLvjbH=x?0TaZQFw zueS^4QMLt%$9c{pUxvY!2MFox@?52&EX=9%tLw|khWge@Wo>SDaei^GJp4J*54~&a zs~fAsDbfe0zFJvb8BXVK!eHyn3d?!`USHE6R$UCDtIA23MDGVFINPkTvMnHAfm8mz zBSxb`rS`*|@bDms3mZt8Ux8EXCmDg^jeBczhx9)WL|NZhoL!nzD{n0<%vClP(S#Iv z9(v}LH;2>Y3=CA3af!M_|+LU_`^EfnvK`?R#&IqMD}887Ckf;XR<=d!@t6Y}FTo8XgY*n20==G%Kd zku321`5+5mJ`!Vce!nBwu{Q)#JM`rJsT%^5hu3%Do?yrRtp~Eny#kpI^o<*mC({My zUJA$~cOD91Va@+N&3EV@Qu%ihW8XpMn(`8R-Ko@#``dZFBkmn|t-YkDN^I(Qs@#sn z+~Ll8BBmWgLOi%WQD)+AWgM%``=kdhwrhCE?I2ol!EQ&{VYojQ;eL|J-|HwKQLjZ4 zh~B1~X90hZrycR{B;cPRD>3BLQRTxl(@DtL3E+uRjt}_pI@auaPn7Y*(bAukd)vP6 zcvHpV-rk;!eK`Nai#6Ng^5-Pp^YPgMe&Vy1H$~0-EDbN<6^J&7n#s&YGO>&={_yR! z)crRE1m&$Ec9)`VNAF{yn%LYm;J^tu!wx6D_oOFFj-x8+_EJah zd*A!M-}`;v`|0WJTlOOxy(!j-NgT~1J#lMS^d1q>b}Y~8T86ka+}ZV;y= zinR@~vC$Tl+FJXIFx9n&PM1{0zGd|dQtleouvhNsnql>~4Qr?Tq*Cr#-Qj?kUWs`{ z$kYbJwY4r0>&@jm#M643r*-PgL1%?J=+r_7o%@yR2z3q3b;VlX2t7k0{IiE!hTauj zPxIiv1>IG3Q}669F!LrnyzAY~LF;=Vlg1jMm&X7b` z7e$A7L&v<%;-(Jv!e5;UfXTMrkxkR0C|IUjt&VaUxj1OzilM{C9B$64PK@3%d89qj zE$47kTO^=M>L4f3p;PZ3BFlBl>^no#)Xjcp!=@}h97^Hl1N6$k_IA@}98P73-O=2~ zN0{5zp;$a^V5gtkvb&v4pu_M0m>9p`x~T_jmV3RBysJ>;iy_@8`7WWqT}78uS2r&D zrX|)0N~1z!ltv7_y%!BAla9-oBAZy-!eZOb64HuNmjA%>;(3V9gK`8l=G83T?S*9*o}ACbaI zFv(ZGk}Ap;^XhY*dd=cBlp6#mO5p_Ln@^c9KZX?3b9VgzZ=z`$5-H3=M01s;R1wiw z7+%?8r-M#L1H_AHiZX(2Y`#+D{y1GqVX0#Y9S_i;JDsm!ZVSvQ`RNwRXf_r!&ZF#O zvg^|Z&!XuknlU5=MwM#jnjn2oK(n!J#TQWV-NweZ)|FaaQQHriih8fH*;H26R@ao; z{4sn2Wmo09^8!$ER(Y@8l2_Vm_Z9W7JWqLt@73$dW_xX;F`vbsM+LdA zG}`K_yt3A)tDASgOl>L6^#}7)QWs4#gn%`tH`{W1e8rO}x6)GNHq3-&5jyTK3G2bg zy=KiH$wGQFEoFT}u2I7&I#^TI6*g_U`bXiP^6v#CMVgOKdFVTC38YM!(;U|U{BM)4 z=a!!ZzxK*u*(_@=fr0REbqgNsg>nXldVwI>!=26qPlna?kDKx{{_|+=mvcY}CbXmm z!gb>D1X|=fLntA9E!H!Zpj`haFQh?0`k{c%tm|&*(d90y=(w#pQ0+k@3Y_9Ju%1RU zwg!F21trE9IE`U5*(1+-OiaH~;W>1CTQ@*cL2H6$BI)StSSYRyl7`@~qZtmh3*peR zUf?A$;h+iI7(RzindGUbMwVs;A^k`|XIC5o#X1hN#KFJ+GJdFSs#R6-a@B&TB-+UBJJC33t!S*nJimq zaYdaatJ3JYL)WtgYS_9dA94}a|6m_B+*|wr4A0CAo^SwWUhM#EMb4HiBjN2N94BXA ziZ$)Sckx^3T--4fY)~Z&D7T|IRO#{}nQ(4MchT7zG01-6AH9dX55;uPhPSwV#S|?F zx;KX@2>ex)A2P2h6~x@L5h{s6)F$L@G#A2~r>j7y(TW(iOnol7a0%v9W$ z&;@s(IUdm5b+tb16Z9pAzObr(o=j8u@+iXne?vmb(`aAdE&AvQDd-d}yB?e!y2;L{ z0NzBE1DyfheEAH>{dM#?!Xi_*hlUYqK#ETeUrd?qEXqgXkoxGHpKbWI#w!M|qk_L2 z>9MX6nHGquLxeAVk^%X{W$ymPnq2---p*CtPAc_--7vN03qt5rb8#&Z9E0zn^8t$C z8%ewq<||i|RzCo)caBNRFOge$bfT#=n1~WUKb~maYc!~$%HSNDs%q{Cj}fc4ai(fRQzKz{Dvp}R`~v3{_#QPV*yv_J<~H^uiOZg z*wVO`TZ*W+hqv*~17>lt=9ZH^RPnU~Jb?Hyy`WGJ7A!|IMJexMahLoQd0VxW2&Q zjobv3!s?fPoMDvulOP>|Qq@rXJ^ZHhisXv;s!2zt*~rTa`IKKCSGbgWE?>&VdU$% z{I!GiRuW`?1+vCvRx(-RwkZMo4=?H^pRD7>H4ay-tRCK8@+mq#D+#2yhw73~%yAFt zi~6~I6`c+4qo8fGYxWYmX2nV9{v?a$;({|7-MDQ^bU*f6!M}vcbw(#%H>L4(6JZ`z z;KR*IJ=sxeHI5^d)D;O{|un_r63n($J3E0&2yYDG68n+=aq}&D z{jqI1gDWpHA1$@~p@1&H#Us}q6Yi{*XZfx*X&-C~4{!Qb{I(vhE&EpV%PPc1Kdy#f zO6{%d(LX*Fgr8?Jwbfr_igosBwX{M%t(I!xgwp-W)^XN#uU-nj`CRcoNJhS2(wk_# RJK@_Uv-H0)?x8(|{tstPO-TR% 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 deleted file mode 100644 index 7a15bed7fad2aba1c3a0f09efc655d9d51131e16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7509 zcmdT}O>7%g5bioZv@b15w{3o0+AiCwO+#uU7bta`(oO7y&?GiZQqjo5THDXg(#`I6 zciq;l%%MmiA#ni-^$Z6jB)EZu)Eft+ax16@3keRKIQE1P2j0)_`gzw*Hb1IFFOA>M z%$xb z$!pLu1D5|n$329<$37G=-fPnrP)q<)N z1YqP1Q_2;sqs-N9V3MqYZhkgRw6p&Sdt9|6)q+L zt#UFbBX!Z$yFX+bYW|$MW(LMYK*jrL8LzQcJvKqmwlU;vE5&jbB zzM*KP;V!iFeBz}T-J~6Iv8MUh6{JG-SHJv5QY$CG5Y*&?3iIXa-Mcm9scp)n2@XGp zyxdKsqGv%bRpNQjb4ymM4t6xkLtwX6({!!2W(`M>CloyKEzpgT;17a_R!%O;+cn>;T8_1AEA?x!J{~fe7CZ`pD0#>6!F9*?}(cI@lk8fj7H2aH`T0yL?c3)VINVMsm7bQC=avSzrb*pk4`Z{2f>kB(+NEFCm zAnAC((4_M|=zBjsq_vY)Wi8qdhBOzTK6(M)web=_xZ{r_>_&r{6c5G~?UH)w`4I~Fu5E2jv^ zk%v9ptec4p=udkurG!!2n|z5UBcQKo(c(XffPUYMq25kep*pLpn$|8gDtM z@QC#LT4q20@_I3~h`K0*Jb#EEwg!&-M<8rA>iAgQ3*0Xp2-~OFkjNWKL*lWfFX(S0 zV1VgSHGJsg*UhD0db6QFq@lkrhR=DDJ;|)3#H|sa#R@{hAptX+8j=uP^a1t*0*vX3 zAprABZx*nhC}5v+2^u%!aLmtz;QPZ^y(R9IY(gUCv!0cW7}a92A+gzMNF$78A9jy9 zFu*j|5ZL*pUF-(k%Jj~Anus+!`taQii!|K^-NW;NiL@t%AM^YRd z^20{>&v!!eX#^Y~iD0@nI@|ECxiss@&{lU z^lfpjgP8zReY3BV$%fR=qKo!yNJo4tt<7sYpfeL79O$hI&k}UH^Nxbg$DZ&e5h`X@WVbg$@lj_IDs=4scN%k=%DA&D&AYk9i7UCu}EJd#E_-hMuouCLm* zVI|}7+qZ8!t;f3>MYr3l^b6k^bb)S{b#rZeBk|@|lMgs>6y30{)6gcFSE(%i;Fjf9 zF44y4&M$OBThZAMjL19mX42foC|qEF{LOJ+L?Wr_uOrbJ@_8{fg+DLGQr_pq*tJBV fmkhVFr@XH%B+4b8TZk zx9h4%6Pkp$aDfAGLE^w+e*hAH0&qZr+fF-h;>-ai4!j?B;>50-Zo4e5zu)ise!kz& z_w%0LyYE?T3tSXekb!I&BURkm6LA}fmTh8FF?DgvZ8niDD(1GO>ByEuv9vC(t=GhI zX|;BNxH_h5E2tp0OtYnIhL#- zaiy|&8(~?Mv0PtaG3rY+M!nRHQQyeV1EA=#B}OINo_A#Cc(cT`dL+INk}>Bs|H54 zA?x)Laui#$uxVF_X`#?UxLZj2m+8yivNW956sLKPg+eIF1rggW3a&1SHo~rL%(J{{ zfKK;UJ)&ksOREFlCx!yq@X@*WR zf)Vwit7_(wX*9Lg@XJR9T6XoOrt6fR!w2fJf%KxhZQ;G=aAhUDEj#y~!?&i90mAaO z746H&J9}O8s9IFjE;Eb>-pt^1OvzD@e(S@^iR7T9kNH^@F30jYp+!Etbm3Se3gh3S)v$*096OoNo_ z$qAX?bi#ilz#HHdxkZZD*g>{K-zC|*%TJ5Kv*JZ?Ay9k{gVf!Th+yY7xC1PL5vn{W zeT;aH=4T~t7u7r|kfv0nPCUJ9Amv&_qfvumOOKF1seHx{A0dKAQjNIQ%qnxNdVVynKmerzO-!F)vFcNC!2(0hVr0u; zgyDk|V7yu@*2;~$Yt>45X?1zETpD``roi!PZM{+<4+4F-wO%Z(uC0tE=);}6Yisl& zS$Hh`Rs2B!Zywx*KtrqvOSulYNc}pkl?dum~=m}o*Dwr@`Y`M6>=M5Q(sghnYu8!t&an)aEj!d!3 zo*NCCfak%uLqv=$OphOpHnQ;pM(`27s0+?Gdj>g?IAk~XNyI1JA#_d>7T%6qI0~&) z?MCF};+u$5Hn6?Nmd)7UT$~Z1K=K~iQBH&5JEUDeIVton@$-C3wq(ykvpjBjPdgYx2fc+ht_mD3v zbi%SWNQZNAEON3yB$-nIemW#2+J^Y?3xI-?;8laNEU+?@yKD_ite_x%AO3uwUi#pN z9J=gJ0!S~}i0~_rg&+DwD@&v(Pz;X(L)U^2!C5dGh|$ngPvYr>WPc{v-(}Jpk^R8x zbU!&lC-~|;X{TG7hafEN-NTCSRiBb|a=>rsrmRwhS8cgTw82mts^%!Ntu~alY_yQW z&~OpSehAVfq@&1IyjYjN5Wu;9_S_`HWZHX&b$Un|!6VPmzXE`Po_XoO*9K;pbU6v% z2gk{D+Zw4>f{oL)I28#;CHuA~UP*W^JYW3CKv&ABV1(I{eQ)4g!A>J2z3@Q<=0Hke z6U4WF8ZLJG&;NP~oC;*=z`q4BHmE4@Y8=QxYp;))*vf>RxM*eFPyhJy%S02-&=1mm zE~X3Jjdh0a!kxZtcykWEbAYwK=Q_Da&nHDsuHh2_jP|njJ|KRW*JIR3ANJO_b#hec_yhY^R%nNA;w%@6X6jOB4*4y8h0NcbD!MM&o3 z>k=~e>vGy37c#8u{zYP++dk80I0uHpy*W3-D>i6-C_MNmF?crd<$TW1FX|Jff1LX_ zq>L2j84yp;E&Gu7{Q`@a;=9QdX4d-0<-#+Fma z<#u;>J#gKRQQ5_9emgj8=`wDb_V$&-%zH~Mej|YM+au`QXDpg7AGJQCfbS$gHrtNok4RO-iNi-K4aU-+Gx*^XgRh cQsoN2&I{cB(eH0fiMaV=mi&gU13Ccw4>z@LNB{r; 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 deleted file mode 100644 index d9633a5b8ddf0d4f82641eee87990b9552679056..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2908 zcmb7G&vV;E6t0}4P1kL4R62EhfF*=U3W+qR?F>~&J8~SS8S=x^xP@jkV`OP%FOel7 ztzy!QFPu1VDLwVd3AplKaD-cX;lPQ%fZ@dMN|qJuq>e9^t@plt?|a{S`#yc(w|($F z+(0f041z4!Jc6W+pdWa|Gd%}3Bilv+G`)_G9TZ3qR(9deZXK>yHtX+E*U*as6REJ} zc`XOYrsGAHY+=LkTDIeL)lC~yr&ub|Kjuur_8Mom?GRMkOF z1BlZc*Bnf1b3UIcMvhfRZQ~Go!TDStp+q!e2bpruPu(`cgV87Qnl0bQNrg1aN()k@ z@?A_RWP~n&=LN8I9^Hzi*jnN$mj)`A4wcf)1j+C*?E*$O=HrgOm zCpr{{>L8w}`XTc~5$DMASAnPbgP_E*X9Op`Ib}5~(ET0d0nh&|jI+5of%i(gnL%30 zXsGnfZ`$msP5Qg`v`vT~sinternalAddGeneratedFile( - ' -ž -$google/cloud/dialogflow/v2/gcs.protogoogle.cloud.dialogflow.v2" - -GcsSources -uris ( BàA" -GcsDestination -uri ( B‘ -com.google.cloud.dialogflow.v2BGcsProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' - , 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 deleted file mode 100644 index 3f2efe820e73..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' - -cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' - , 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 deleted file mode 100644 index f7c9f4f8346b04c709d395dfef0c00af1451101e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12742 zcmds8OKcn06)ma%r9{zBvQ3ShgrSqzF&wg?^KsQFPH&iU38BO?uyZ^W#S{M{+jx z#uVq>`|ju5&%1B<=39-e2AoSQD7w;=Ev25Q?j@`(CDCXamQgdbM76cCp)?aUW2d2N zN;8#6%#{+$rAi_{SExLTq^8ko)|A=AreSPqO1h>Qt$Mny%9^pcp&9qmyP34ATZ(R_ z7*7CQ-cihkTvHMY&$;C5w=!1&YMN}Ci2`E-4iObvlXSf{%;by-`VQ_NaZZCFOLj7w){Hxlv7xSux^7S_7`iz->*?gNIEXN(spytqH1n#W z)w9Z$ysH|`V5BRG4VAuy>;Z=LoPmD$Fo4uWL*Hz+bY0aq*GmnG@?e&70f6Su?=-Bv z{0s1nqzI2_&7lo!+ue(T`$7sFaVuvE>JpAZASU=xqoDzXA zOtFAYc>$f;%?PJ$CUQf?fTt+p!7V)Fd$2*FB2{gy*b8QS3z{|{>_->uN4+vgjeFf* zdCp#`d9FtFz<73w_up_8rLhg{elbdkN{Y$v(N{J@_k|9S<6c{(B| zV320CcqkFNFqR$oyBH!fFkV;9h9>Vx>`~Zx6ec%d;+|67GK_7BrUfNFjL)K(bc%1+ z%i1ZvQR+6QTcu=tpOY}!Xkr|y)?R!7`3&)|;}F4ghzU@u%C+tIAU+v&pX_K7$|hGe zr5>O1o;(9YQ+E|f-b80gTe4m^Ha6nZ-h#6*spxe~vIsSq<F; zZ!i7C{{)jU0}wejLF45m@IJ;&SHHXgu1dJw=_#ac^g<06bXT7Z5YiRGd_u2 zqnXS7b4`_PTF(9jm}we@C2bfQmiAVI!2$8YP#$v(K0waF88iq*QqPqq=t}Y~Om{w2 z^$jCVnCh?gA>_O*1~+E`iK&Q_EDE5~4)aF$Z|rA$b)Bsa|9nVwF4PytKBwTF&PR z^M(9e>>DHkBl&m5rE)PJ3y~O%R`U2+tmI>1Av_uq9)(~Gh2ufcVeaW(`H-M=yRz0& z{L%?9;lP(aqvF}xJP&c7o-~Vj8Ft89b_&LJFn!6`pY5^iYUjRb7{P3hHJ~jm;kTG8 zHPy5*FFAQq_{BvSvEz!o&EZg>bjYF% z6CbqH+BU{?1IsOUXe9G`09H3C{R$^Xj;K{lZgTer(<+B#$N(+WkoPo0uE(kIBbn2V zFiuTP@y-R;-h!B^?ld&T%}LY;lxWr=>d|F5b zR%9GpuJ6NiwQ1bL^5Zhc5B2yd#`;+2J*#Q5i@I%*Iw29%aKh2m1aeajn+q^Kk zb`)%IdGmrPH_q4viLNC|&l(1uhWtC&nAwHXZt#v=bA=hq%9u!KpJ^w3r>7F$h9Q
>XE+|jrx{rx_3k*Acf4U_FG zP3(KRvtfuS93zlJzmucey!*?L>)wer$dXO$^&5&#BSErH0@TBiOyL-trf_heuQgSX9elX4&%#98 zx7Z*JxZx)x0KAml!xdrSTM+S9n55KRe>fn5>6vXPZ#OZ7b!uxjj z;2OrZj;Y{=L|FJF4B%CZ9*Ts>GJ?cX@N_}*La>tVaZVMG1rwb3(}pjS{)DN9F2d?J z$j%8=?qEfV7bnWZIV*%cjXb4kM~zluLq41p`TNr+5)i^~@qB^_%U3YTiep6X`0D|{ z+Rn){r0{=au{SU?vwp>K9);?*vgZ}MFvHEBZs>b96zvlAlR+5wmuFH1;N_kjmne#& zfs%utS;}cg*_Y0#Fob*9Ern72HnwO^Y}^Ro)`PbxF`mL_A((30o`2tQ_Ugd0i}Dcb zBIV|$BJtA+4Yi}Dcx-v{7?n8uVdu$Xu$h7g8zJH7pw-ma(PAt+Vwa(04oDYPqz$nwOUFRzj3|oLa_)2NoxT3>a;fs({$Q`LzA=m6q?}zvpk;rB%(iVDN$~v zR4(JlXaKusk}a;StmNmUteCs8uu@uEo{J3%pNC=0J%D*2V2wyy`S)cjxAGn*PvNor z1YT;kc614+6nJA`(P0WdZ3JmbbBssXWx>3Ir@ldYR7G&nJ}AiX(KW`3agX!z^~}Rh zsAv8%1hG!RNfd^+6uFKe!L8qf=`FlaxR3WOvL@m5a8uvGsT(`!L^GuTpzqu&wdnE{ z9kv|RRha7Wj64U4#nMXQF2YqTN@B6Fu)Ku0?LZ*{u9z3+3d;)!M1bKOF3GPT631~w zxgr*d^vQtmA&mQtjKy!Lrf8apYEx%j380wECx;BUx9HeX-Broo>^fvi%2u7VDJ0`$sI#Zo5tt@q@iQ3GIxqP-%y1@f(wTKaAtC=t6F%p+B;znTL zM&U+mkcQ;y4IJXeh6u(f8X+GWreEGFWYIb!7-c7TURae%%hE!rw19KnQOuB&{Ij$u zE-#eUDyy+bb__;#_$7mI8%X!iot*8SxQq8FGYv=R>=i@>2$xlN- z=(&jRY_2FDwD816@WK)A8E7c7K+Rsj%ZD$;Bze5-2u@AbH(Mw#PPpoP4sFlW-^Qy# zCbzV!D);Qt_QK75vUZyDQ)?yI-S8cemR$H%$k zG7jRIBu+>sA1?(t4U;+@&-ixYaQZdox&_6yp<}|={C7Z(0sCVS8@ra=J24}spAo$m;5vgGg;ZH zZTSuNL~=sRj{7R*&gRC+lc1LJI01{_aE&5N4w=?pH2(6NFy&Jw{SW{xoF!%nyVo;Ik`UhUAmBegh?$g-C&U zl&N~8RD1C)0M3J^esTs*<9UO2W48+V+a1Lj?~nZt=huqGSSa&(3`RHylYAD2h_48c z)M23VEwpo^aOmqYZR@!slV63t`_sL-;(s z?jRof;_0?9u-g;7bK4h%UQc-A@<=SftB1T@*~=n!`9EcoxjyD^w2-#kPAMHR3WO%;O@eJ?s*cYR1<~1LQX*k(w8-{;!fXRdpABi&up0Ym??`&CC!<internalAddGeneratedFile( - ' -Þ -/google/cloud/dialogflow/v2/knowledge_base.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"ü - KnowledgeBase -name (  - display_name ( BàA - language_code ( :ªêA¦ -\'dialogflow.googleapis.com/KnowledgeBase2projects/{project}/knowledgeBases/{knowledge_base}Gprojects/{project}/locations/{location}/knowledgeBases/{knowledge_base}"“ -ListKnowledgeBasesRequest? -parent ( B/àAúA)\'dialogflow.googleapis.com/KnowledgeBase - page_size ( - -page_token (  -filter ( "y -ListKnowledgeBasesResponseB -knowledge_bases ( 2).google.cloud.dialogflow.v2.KnowledgeBase -next_page_token ( "X -GetKnowledgeBaseRequest= -name ( B/àAúA) -\'dialogflow.googleapis.com/KnowledgeBase"¥ -CreateKnowledgeBaseRequest? -parent ( B/àAúA)\'dialogflow.googleapis.com/KnowledgeBaseF -knowledge_base ( 2).google.cloud.dialogflow.v2.KnowledgeBaseBàA"o -DeleteKnowledgeBaseRequest= -name ( B/àAúA) -\'dialogflow.googleapis.com/KnowledgeBase -force (BàA"š -UpdateKnowledgeBaseRequestF -knowledge_base ( 2).google.cloud.dialogflow.v2.KnowledgeBaseBàA4 - update_mask ( 2.google.protobuf.FieldMaskBàA2´ -KnowledgeBases¤ -ListKnowledgeBases5.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest6.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse"ž‚Óä“Ž&/v2/{parent=projects/*}/knowledgeBasesZ42/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.,/v2/{parent=projects/*/agent}/knowledgeBasesÚAparent‘ -GetKnowledgeBase3.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"œ‚Óä“Ž&/v2/{name=projects/*/knowledgeBases/*}Z42/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.,/v2/{name=projects/*/agent/knowledgeBases/*}ÚAnameØ -CreateKnowledgeBase6.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"Ý‚Ó䓾"&/v2/{parent=projects/*}/knowledgeBases:knowledge_baseZD"2/v2/{parent=projects/*/locations/*}/knowledgeBases:knowledge_baseZ>",/v2/{parent=projects/*/agent}/knowledgeBases:knowledge_baseÚAparent,knowledge_base„ -DeleteKnowledgeBase6.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.google.protobuf.Empty"œ‚Óä“Ž*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}ÚAnameŠ -UpdateKnowledgeBase6.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"‚Óä“ë25/v2/{knowledge_base.name=projects/*/knowledgeBases/*}:knowledge_baseZS2A/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}:knowledge_baseZM2;/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}:knowledge_baseÚAknowledge_base,update_maskxÊAdialogflow.googleapis.comÒAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB› -com.google.cloud.dialogflow.v2BKnowledgeBaseProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' - , 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 deleted file mode 100644 index d76f6e52a923374c230784142085c750a89251e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12033 zcmd^F&2QYs6%SXICC$o`GLGc6k~kYWv1LWxO*iQW)^Sp_d(e~089*Y<7QHuGDpW|O#i z-QIN!lemR^zPg%US*_=5)#dt=AnMsIS10BCwry{lq^O&At5IwinrUx0P5V~yW~u0C zu5ajuqgj4|DMrZBc8TX`I>|4sRjv?UYiPcazv)lkRgwbBKIbW`)Z{90QV zx{dPi&uML$hMxC)4JOGyWq7J#89oRb@4$L4=9`-75s>d5+iY37Z`f9z3anZ>nLC%~ zI_cP_92?euF&|j9MqL8#*j%=J;#!)yStXwC8jf$fYcRB2-X?zNNcv>%oS2rXGn)B1 zZezLJW#q-Y@3u&E_I%zYe#^BkFuSRO{qWajg3lDk*i|`^t7&ZaKYfy-4dQv=v;LKYNMJs= zqIowCA-e$)*9Y)(4;vAkO##f=ZM)SA}^X0Z0eRkn;391GQbs( z60gpSS8T!<8)+0bs?LBThR>x8_c%Jl$bjY;jR6@Hxn;Y60Wsn+p(`BWu|SKr!J@*q zeh^JDAaIB4=tW8wEswvDe>RM=5%R+iqa&0=b5dTK8>Z$N81z4p-1hlX3Nv*mZ6fj zIUlMmkGQJQ$c?l|T4=Um>#bb~s|VUR&#O(t1Q9Pcnjf0WmTLVPS`9P>8wP-r>Zw`2 zyT@EG`x1IQbrjB`p&Mk6dkr5$!#6dv#XUAw&U{Cb*U%B_5Bvz4T3@|fQ?IUUtko8m zFD=)qQxD-ulzsW?6=g+LmTD{YDG47(lgicl>J_D4tBQviJdQ?dD^>OCMs0m+sQh>7 zOXYJ3Jsp8P4-6pQE5OEDj06L}0?2ri=)PCHEq?760joD*nVi{+x1)dVM>kh0)7~EU zv6`UEv>|A8hbZ0-eja)P`6t6@gh?kY*lpCv z%rp*T@`n)ls}7tYNP=@?k)z=sU{V%2$`~!CU!_|;b3{`1hXo;z_q#{XG|RVl$Ra1g zAS{(mG<8C<&$weaUHH@;hUK(;!D3IR0kRIGm+9b_AA(q9$xX^4T$)qJnKbDd9Uh1; zBkU5#+*70FRE{$80mQc2^1*;e@s1TV4k_yHL0DaF*UNEgeJ0J6SLt{NH55R!005dj z4u?ZX0kuQZ1T*IwX_^!!7S~rm$MmpdK4Ui`zf|vysPN!+OB5H>^ zI2!(8=(~6+VHFBQMz5Tsx(36$RSiNqDdAo zhE$FWj@J3KWp+ki{&X0f0^AU77fS4Sr~$vQSv?SXsG{+XBv;{6wlanc-R0Es`BA_FgENFE%Fj-8aEXyj+I}BvwFH2CaBmS7B20N<2(^~M9 z22JovDx~YgB+ia)?a`1izVkp$oS^9WCRvYS| z?QPnf3salXShn=7wEPJbueZfTj(1WbD+X|k66x{cp#8otO5}J=#m@nhNO74hJs?Uv z41XO!iTpgC$`D;Fn?Q+(Epq@$#Or7xhBUf|W=rKXSS->uF>p+HHm(L>T?VYm?`6=8 zuvVcpr%4Vhiu*0R6f|MNjtS*Pu-P%>Rn9?Wd`~&u&q3-W8iyQW%*sk@ic(Qp_uvW+ zzrnde{xKX6x*Q>LvVtaAK@P;AS>7$$l;K7BxirrUe=1A@&m?;TI5}a7^7|Q-6V_bP z-r_3$PXqIwgia>7LWHJ_vQ6!+SXffa`_P{QhU6;=%?dj79HvC5e~vn?5lf0EFniR%^-fJF4DKX^$Ti$pq025#Kr0H?>n zp|5EbucK^q`+@^M-<-wHn%ZTG2m+Bpu|`{>tY~B>iE;Vg8FV~pQ(Hqb4XA&0dVHh} zK3b@=GrpMh*);m7GD&)kMvo1`**DN^Vo9R#wcFd&pTd zvZk!pmzB%VKORHFmzG!HXGZ=)LdQCZ6=LBVJ~Z@Mdw{mCTdu(ZGlr+osAn0DL*Q^U z1Sgp>dIn{IZxC1#Yn^7G@E#4C?ocYzBhw!Q-NO#!Wr!caQDLnRiHdpF13@IA01PjDrOZ3h8>;fHE4bVJr-z= zY-nxeyg>hEU{zA9K`0Lc7gevJQ-S(6Tf_F%o`7#PsmK=-gkfXbU$BD8G;9Q+Q$xM- zc{CY2>vmsm@Xj9V{=SJG5$$}^5Slsx746^4<3}VCmj88mGY#pRIWKHyQMB*WChs zKF#p1;iCCFo8F#_Oe_ChdiS$0KFs`FlAos^($MQYaQwya0%bmSH#pyUA6Smwrd?l^ zzuQAe`}SoJg?ALp?OA~T0#D)pNNA$-k^`rnSvtoK?xOd(i{8Q9L-bBO#Xp_brStpO zE0{YaE|=nxxQ;styNSmi0QbhPK5!~$#zzOMPlZ*t5a%hl24Y|dJTV|vLQizdrTC%~ zZ+8@N$AC$x}lb$YJ!vk;hpDv$p5ByFlg-8!@S%?Q1h%9Uzc*Xg6P&-rS_0r`a zb$TjH@lvYtJIaYj{wzeUneg2Vn&@m0r{_}V*ua0KG?I#o2rT_8@TB}oeBlFRS6QQ% z&Ee%&S(?B8x_m87;UG@zQhrC7iF%SXS6Ej#=Hke`7ybopjwCnZaccLehfv`33u#X8 zDJ#7H(46$Fg#VmDlcFwBL`8;EV;LJ9n376CT{6Oizj6TlL6X;lc%|<=af}z+6_ZyM zzk_8^An5WBdng_N0|!jf=A+MmkHk{jMPxc3bqx>vdALed{*-(4BT26JSoi^yl(g9P zVyI7v{G%SK@6)Fp)3m+%59kgEH$^LFoZijnm2^}f@a$nrboq1c+mEF-yWBroqZU%{ zZp&L=k9T7eh5ns=`!CALo(I3bDX;DLzT=gP#ap*-3AzctDT7|h4*wYYyaVkGdU{wm zXn1?7$}c5!3O-FsA+gHTTD$67qu)laN!MTG1$^+~A$;4mZAU-91oNPbZO`LuU5Nhi zUrG9PCR4ri+sy0|`xLyudi;fI_$hedT50PjJL^1mHvB4efqy+6`PiC%Icew#A6m1K M{DbIyw2#pL0LuChNB{r; 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 deleted file mode 100644 index f39f41eb8fe642395a94ef521360c7743c1ac865..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7687 zcmds6y>lDa5f?yF0+tX(JyI4#Q}PLtBkBuK;E&jlWD6ufijF=Ql9443#y7{q18~vt z4!(Csn&PlYpC+l(q)Up_naLmEaZ)9jG^tV~jr+`KQf1%A9YFGM1er+_6(WG!-M62= z-FbyDC-&~)fSiM zo>1Rt8otq36#R{O&flm-{Eg@3djO_wFs7|aIj{p7{_6(owqPJ6BEqTLU)P@`q;3Uotb$?>V@7IkxU9+)@xf&cHQ@KYPj}6~;1_WGG?43_6RiD*nGb+ag1g+Vq zfOt7whi|?Qv%{hlnU<7AljBmchik>n^7I8I#pqgyd%Tn+#7)1`_n^h=MPFA1qX;hc z5qPR9)T2A9`Ul&R4J*RhaDn%EiKi%L_Df(QyVTRr+g{f!aX<~2dXQIaT$hq9@8p!cMZ?jVEHr(7%Sf@O7gfoDgKDlFLQF##be|lj7bre(+&Lmh>-BTLnSP6>bVhA zm3#)1Zs6lry+0-LCxxUtNs^ukwmu9c_aPr6OXqRPpB4hALxExFiVB&tP-=gas z*L|hSyigt`p#aR7q68f>1-X7>g~xJ(+b{1#By$CqtD*T_NT@cG~0v$f!zYXxRv6+trXP&NZs7k+)zR9ZG$U7aRtdFg8Pe z2vadd%rJCZbYk+T8t64DG7G1>#IuOXd~fNVd2QM!r#8wPUfoKP{&orY11qfg=d2H%IX3eTb{hv6Zj45wt{&yR^?3WwW3(8ZERZ;H;kFNir5 zlqP5hcG9-vGThB@FKfA2g^7kdhl{cBAUeW1!TVm4b}_KPSqr}(ff+;~YHVPL_x2=A z-2aDJUy^3G<3vgmV&5`7MHOb^_-W6KFh2K8Clj@G%Q; zT5am01G}vjwnT-S7sG^#dR4eZAyQ7YERTirRXEBj;7njd_&5*^2|M$kDf~k`~U9uWX_~gmy~IO7P|TaL#dcWh6fs!C17r z#2{jW6t`7;ei!{^LU`jLT#{R)-ZAW!j>8Y5d$Lx-V1hcILF4*C5x7N3_}e3l;F(EU z7JfYfmj)nb(loyUq`$w*99ISRVOVgngI%cRN^d+^krV#@4MA>9|ILOVH>F`V1hLT! zg3;q_2xJAuW58~#oH+I-qhR5eBQPBW>!1T)Ku(P-Vq+KhI9{GRUO2)rhTqE&8~}an zIr2hOggHwlAcOfWs!{-EhEw5u(z4{B$DNQf?m{QTgJLExdp+HKGaIW+4BhzPegntm|tpm+ShEpRO*~=a&|i>a~dz zIH{odlhk^3 z4Q9md_L}OwxnGYaH=$Lg@FiS`k;9uEnTM%?jAP}*O(qgqxC7bf3&EX>nXV^2l1Bez zH*oT_`~Wu(?u&H!pQDgbt1BbljzF$|4kV?dD(I(Fi{|v*;Ta@Q7XF(4>0kcwi}df( zg%A1rkR7#uKft-;CwMu|_;a_!Ftjxv2+#s3Z%>);5xN=_>UJftl=!*WWI;qUKEwe{#qvYo)I3J;2f2hbu zNim9L38VY*F*sG2Pt2z7rl!CCL-pdoYs5cSUv_-I%POVP*4CCfD!OAd0>2~Qpxx=> z)YWpmjoXKj_l}zTZUiplRb_$!b2(K9%lxI*a_WmuWG47?|X3T3xK`CDk?!qp>e*muj9UcGx 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 deleted file mode 100644 index 51d43436e46cc34ccd380add5212c419110897f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5745 zcmcIo&u<$=6vlR2(WwOO5+$vxwp%x-sY!Mvw-Ul7rJL9ZQR~`D(^j!8ne}>{ELra^ zJL9Aw@+AkvjRWF>kPrn4i6bEX0)&7g+;ZZ;seeJmiP@Rmwd0+&vu>M1{A1^R@6CJf z`{sGxeb3&s!4+{Cn$S@(Y>JIt5pP1#b}VdZmLWDetrm1d&1&1a0Ub#c3uWPQ)G1<4d%rS%i1uYtQl6PDK~Z1ur^wTwIgrmWCRh?Ewc_ytmEA}-nF4b9ROge zZHR1DgW_^!p#-toRIyrHrdYK_7pqnXuxbx;Hv!NL6(R9H!z@zBHG&BCfJpxAPQ%bO z5n&aRmuVfHwbYQ=C zQFI{gIOa_nw+qk>-qkpnQ*6Dan5N}s!7@=k-`i6UBFb>l&`G7@*(~YMXfD7_bz8Tb zc&4k+YoQ|t$?1z)uMv*!J*XkcV6koE-7!q*#!D*N;@i@;nY*QXO`%DA~?)R0lZ3` z=n$PviK&@Wxw&D$491lx50Ro|_7gw|dl069SiHBkvbJ6?KP;}Ut`v&(QkndFaPNMl zxVW;kQY@T)MYs$ua98;@rxU^zaEZI*{)0;8Zm~q3olfR|Pd!zBO@X)i8iu8a^a_%Q z=*ywB2t`t-521#Uyyv~^%IXHmh_CbH0b=Uhm1&}O-OZD4*$1lsU7;Nb1I=ySvCKAE zPK|<3UAcpxL%wrgy7AmqIqnQgWBMrX`ESSC%6=jq_{-Q}=8FWla92k-R4}v(Kk7h) zg+*|}RvnU6k1^K?WBya-gjm&|1Sf4$?K&doDW%nMx1AHh6ae&lY;8f4(88l+BJ)WC zT#Skf+2nA7!W}T-HBA4AfJm4l$raiy3FLJXKF0OFXk7N6%zOaOFT-$p{Ol-))Wpk8 zEM{bWAzNK^Aeo~=VfkKONDa#14NksjHAZMrC@!W&-;=-}*ktsI4m`rAtG#3S6mEc1 z9qO{~3cVM6+80tnC^}wA!TCztETe&o1!%w_fj)m7b5AFL5Xux1eoKK#ekTj>_;GX2 zUx{zybwoNpjwvHf=I7-8-~WD|{4OcnaOdnjM(_DRjk1HnoIRw-)sk>$sNEr<%6jUX z?FsJy+=6gB0?wCLB##PdU3he4jCkQ4D4zTYKc&C~PYQ&$ht+~-;TLh}01#@W%#Qux*k^RQd5x%qi zL~iRjyuFYeA1FNL9w?VMrJe1YY=kE%FcmSg4DZMYBfldj{lhAlmFOKt?{LX7fr{B? z)l!ye5#KIuE~^V!COd<0F`A;fo@EL%8Y6Ca-rB9gi!C>Mge1zt$kX z*Eg*G%U2R4nG1W~?8eRh56=>bC&^@C>4#)`nO?a{i|&=HR0ytIrH8r33EE)SuLgHj Wv+RDd?>aN`DwD2cSB_oK1>k>5augB( 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 deleted file mode 100644 index 9baa2f455897615e8d5f736e100c23154b2224af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1126 zcmb7DQE$>v6t;j4?$lx960!$##3k#ZmZbW`WQIW@O%w=2j0*|5lnc8_*W28Ci=`0d@(rdnX@>#HtF9+A-6p5iyOLDbr|Z9U47xt+bQ=dx3K)?JV@&NFYRjuJ01#5E9O)c0XWh z6*ah$){C~IHZyX3Nw|-_QIiOl(?BxbQ>E4FoXB*i(I4Y*)i$D|GcXd3)#?qAHIO_c zo8198ksvO%| zaXRf{MlYcIcE8{47qj|9ly4}Y)2M$a=E`TNxK@_rOilJ=k!EikYY}S1tg&sqyu*km zKQ#1A-PC^|C%f01$EoXSXUB;RR|{nql{wqII2=%QbZeJ_$LNKG8P^X@FiOx!j2Htr3nZle8|;5}|*}7;6du 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 deleted file mode 100644 index b1f9bc09a0945675df9294d88105e9ba9aede058..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3769 zcmbtX&u<$=6lR?^Z6-~dPNURyrLuJ@>V#w$Oc1I=3Y++cETyq!Cqa!Yto3^AELra^ zyR%74WC;+W7fv9!apB0nfy4oc3*2(bffFZ=2ytL`W_E4Ij_ZV6yxDp0&HLW>zPB^) zzGv^*U{1^-6FDkIb+Ptb#Cu4z9Sd8UWr#Je(Lj!Aw!}<2zjdFu zx|Zi?C?z&6t7#xvGc2zz*LBsfnhnD`ln;{f0did3G9?-m08?!t*H$$o=89`i5LW9d zRx3H`Us?D4E9ua`vXfi^Kr>X=6?a%1a0Ep1XL~h6*F+bqnEX7@-KuWtm^kX65FD#w zLp5APeEV%1o~dDykmx%UObsRGMHbVyePCMz_o^6VRP;+h%23Ih7&)eDRMN=R9Nos2 zQzWLTR1@K_fc~4rJm1z2r#Hj|%Q2PeOLA4jj)%H;7exnQ&oNhM-hO~~_*5BCFU8g? zifLMY6)e+Dr8<~8Af+|9_&k7W$Cfb8$+qr!#>CowIo93d>$WyFJ?hvRGGjSvy`Zy zq>iAZgJkSBkD}T-5uDE<(^l-&u7!qARJF#L;s$rR3>;1eU%Jbes7gt{%g8S{Ukv0O zF0$w?Qr1&jhZZ=f9W#jkGzPA41;d-*l0OBaf+!>=*2YehF&G7tb*?MY$k9l!BEY-g zI-ej_(`(g`6CERqmzmo#nA99ZMpxC}FM5frOeSLz!@_nZSfr3h=9LBGz9v04I!+v} zC*KSl22@+(Ne91W>PX|nKLAsFmA!@cKx`*dD(4HE)$*3IwOy`mZhH3=*N-mB=)f zgHpau3jPt&uqz+&r?#v%NlOG{mn`t|wc+~%j15a;vqL@#9?y;t|4ab4Hgp&B?cEak z*dr2wkHEOCI%HeU>HLWj`A3<9BOsUs6E?}X>XN}td8gD0@HPPSJ+}6dNjayjBE%bD zrZ)xGCZi9*x4~78)FoMrkw%ysfmgE64HG@X)vnEG_r*8B%^V7l20-8GXN(pzBqY=;8fU54b4G|)0oq$~G%9V=XM@K*tVPNTx5Vfl9K0(hfn zB);E+$e-PPctSYxLOVos+OiK%x7V>kzY6d#0ZjEM1rDX4$MjsNUI-MH9UqaXRG^IA z)%XP%3*C>E>#Qjjxq9K35ir%G#^I2AOwR@Rdj|PaAt}+8;|WNoi8}QOS!jpJ?`D#z zp{_$Y4#ONPxA@+RT{8pzOt|lv2Ez-{V;U4A^z0Zk@d9J}rHFTz7Z}N> zEr$Z+O&ojni*o18ulH}t(>;uBHzmu5hlf1f@YAk(c#mDAmTW`C4a;dQzRbL{)!MfL zxJOP1K@kQVY1Xds@mTZ=R1|g}Gb4U#@{boytNRj1QX})Jvxi+<>Hg<$LHHpONoRkI y#B%f+C$0O}I4K=oQP^N1GE=tsrU1-{%4ZwfVinternalAddGeneratedFile( - ' -Ó -(google/cloud/dialogflow/v2/webhook.protogoogle.cloud.dialogflow.v2\'google/cloud/dialogflow/v2/intent.proto(google/cloud/dialogflow/v2/session.proto4google/cloud/dialogflow/v2/session_entity_type.protogoogle/protobuf/struct.proto"Ö -WebhookRequest -session (  - response_id ( = - query_result ( 2\'.google.cloud.dialogflow.v2.QueryResult_ -original_detect_intent_request ( 27.google.cloud.dialogflow.v2.OriginalDetectIntentRequest"€ -WebhookResponse -fulfillment_text ( H -fulfillment_messages ( 2*.google.cloud.dialogflow.v2.Intent.Message -source ( ( -payload ( 2.google.protobuf.Struct< -output_contexts ( 2#.google.cloud.dialogflow.v2.ContextD -followup_event_input ( 2&.google.cloud.dialogflow.v2.EventInputK -session_entity_types - ( 2-.google.cloud.dialogflow.v2.SessionEntityType"h -OriginalDetectIntentRequest -source (  -version ( ( -payload ( 2.google.protobuf.StructB• -com.google.cloud.dialogflow.v2B WebhookProtoPZ>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpbø¢DFªGoogle.Cloud.Dialogflow.V2bproto3' - , 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 deleted file mode 100644 index 664ea58c7fc0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent.php +++ /dev/null @@ -1,541 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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() - { - @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 deleted file mode 100644 index 39e0da50ffd4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/ApiVersion.php +++ /dev/null @@ -1,71 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ApiVersion::class, \Google\Cloud\Dialogflow\V2\Agent_ApiVersion::class); - 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 deleted file mode 100644 index e1e08fd21806..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/MatchMode.php +++ /dev/null @@ -1,66 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MatchMode::class, \Google\Cloud\Dialogflow\V2\Agent_MatchMode::class); - 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 deleted file mode 100644 index c20b42316e00..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Agent/Tier.php +++ /dev/null @@ -1,72 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Dialogflow\V2\Agent_Tier::class); - 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 deleted file mode 100644 index 0317768299a3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php +++ /dev/null @@ -1,243 +0,0 @@ -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]: 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; - - /** - * 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]: 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. - * } - */ - 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]: 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]: 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; - } - -} - 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 deleted file mode 100644 index f3f32765064b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php +++ /dev/null @@ -1,64 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnswerRelevance::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_AnswerRelevance::class); - 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 deleted file mode 100644 index 51a3988cfaa8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentCorrectness.php +++ /dev/null @@ -1,64 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DocumentCorrectness::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_DocumentCorrectness::class); - 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 deleted file mode 100644 index 70517d74d9bb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/DocumentEfficiency.php +++ /dev/null @@ -1,64 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DocumentEfficiency::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_DocumentEfficiency::class); - 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 deleted file mode 100644 index 7191a6938718..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php +++ /dev/null @@ -1,158 +0,0 @@ -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 = ''; - - /** - * 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. - * } - */ - 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SummarizationFeedback::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_SummarizationFeedback::class); - 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 deleted file mode 100644 index 8e11dfb59301..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php +++ /dev/null @@ -1,108 +0,0 @@ -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. - * } - */ - 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; - } - - /** - * @return string - */ - public function getAnswer() - { - return $this->whichOneof("answer"); - } - -} - 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 deleted file mode 100644 index 5ff14a2f9593..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php +++ /dev/null @@ -1,437 +0,0 @@ -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); - } - - /** - * 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\EventInput $event_input - * An input event to send to Dialogflow. - * @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; - } - - /** - * 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; - } - - /** - * 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 deleted file mode 100644 index 7f1ce53b0bd5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php +++ /dev/null @@ -1,428 +0,0 @@ -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: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 932abff578cc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnnotatedMessagePart.php +++ /dev/null @@ -1,195 +0,0 @@ -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 deleted file mode 100644 index 60634917c402..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback.php +++ /dev/null @@ -1,282 +0,0 @@ -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 deleted file mode 100644 index 638d5f1b0759..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerFeedback/CorrectnessLevel.php +++ /dev/null @@ -1,71 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CorrectnessLevel::class, \Google\Cloud\Dialogflow\V2\AnswerFeedback_CorrectnessLevel::class); - 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 deleted file mode 100644 index d215db2c97a1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnswerRecord.php +++ /dev/null @@ -1,189 +0,0 @@ -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 deleted file mode 100644 index ecbdd73bdf6a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleAnswer.php +++ /dev/null @@ -1,261 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - public function getSnippets() - { - return $this->snippets; - } - - /** - * Article snippets. - * - * Generated from protobuf field repeated string snippets = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 615d7a2cde86..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ArticleSuggestionModelMetadata.php +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100644 index 2deb569bf5cd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AssistQueryParameters.php +++ /dev/null @@ -1,131 +0,0 @@ -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 deleted file mode 100644 index ee0084582a04..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php +++ /dev/null @@ -1,118 +0,0 @@ -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; - - 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', - ]; - - 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/AutomatedAgentConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php deleted file mode 100644 index eae81e0e0ed5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php +++ /dev/null @@ -1,175 +0,0 @@ -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. Sets Dialogflow CX session life time. - * 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. Sets Dialogflow CX session life time. - * 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. Sets Dialogflow CX session life time. - * 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. Sets Dialogflow CX session life time. - * 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 deleted file mode 100644 index a7eb6d7bb899..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php +++ /dev/null @@ -1,203 +0,0 @@ -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 deleted file mode 100644 index a82ee1df28e1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply/AutomatedAgentReplyType.php +++ /dev/null @@ -1,70 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AutomatedAgentReplyType::class, \Google\Cloud\Dialogflow\V2\AutomatedAgentReply_AutomatedAgentReplyType::class); - 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 deleted file mode 100644 index c78351121644..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchCreateEntitiesRequest.php +++ /dev/null @@ -1,196 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 5eca1fa7c49d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntitiesRequest.php +++ /dev/null @@ -1,208 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index cd9bed492c1e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteEntityTypesRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 268ec6c84a48..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchDeleteIntentsRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 3a34274aa00a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntitiesRequest.php +++ /dev/null @@ -1,240 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 6a281fc67777..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesRequest.php +++ /dev/null @@ -1,250 +0,0 @@ -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 deleted file mode 100644 index b73eca89fee6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateEntityTypesResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 1420d0617909..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsRequest.php +++ /dev/null @@ -1,314 +0,0 @@ -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 deleted file mode 100644 index fe289de698ad..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/BatchUpdateIntentsResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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/ClearSuggestionFeatureConfigOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php deleted file mode 100644 index ffff95f24c72..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigOperationMetadata.php +++ /dev/null @@ -1,192 +0,0 @@ -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 deleted file mode 100644 index 6c9f54d4f8af..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ClearSuggestionFeatureConfigRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -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 deleted file mode 100644 index 23fa65104d40..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php +++ /dev/null @@ -1,706 +0,0 @@ -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 observed at runtime. - * - * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; - */ - protected $no_speech_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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $speech_partial_results_end_times - * Time offsets of the speech partial results relative to the beginning of - * the stream. - * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $dtmf_partial_results_times - * Time offsets of the DTMF partial results relative to the beginning of - * the stream. - * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 observed at runtime. - * @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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $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 observed at runtime. - * - * 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 observed at runtime. - * - * 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; - } - - /** - * 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 deleted file mode 100644 index 32ef27e208e7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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/Context.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php deleted file mode 100644 index 08daebb8c022..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php +++ /dev/null @@ -1,269 +0,0 @@ -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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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 deleted file mode 100644 index 618526d0cb82..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php +++ /dev/null @@ -1,380 +0,0 @@ -google.cloud.dialogflow.v2.Conversation - */ -class Conversation extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique identifier of this conversation. - * Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - 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; - /** - * 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; - */ - protected $conversation_stage = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. 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 - * 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]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique identifier of this conversation. - * Format: `projects//locations//conversations/`. - * - * 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 conversation. - * Format: `projects//locations//conversations/`. - * - * 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; - } - - /** - * 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; - } - - /** - * 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; - * @return int - */ - public function getConversationStage() - { - return $this->conversation_stage; - } - - /** - * 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; - * @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; - } - -} - 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 deleted file mode 100644 index f2c3504ddeb6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/ConversationStage.php +++ /dev/null @@ -1,69 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConversationStage::class, \Google\Cloud\Dialogflow\V2\Conversation_ConversationStage::class); - 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 deleted file mode 100644 index 5f851d42bcbe..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation/LifecycleState.php +++ /dev/null @@ -1,64 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LifecycleState::class, \Google\Cloud\Dialogflow\V2\Conversation_LifecycleState::class); - 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 deleted file mode 100644 index 7d2a3590cc7a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php +++ /dev/null @@ -1,316 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index 4a557d0712c2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php +++ /dev/null @@ -1,200 +0,0 @@ -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. - * } - */ - 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; - } - - /** - * @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 deleted file mode 100644 index 528852c42e6f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php +++ /dev/null @@ -1,96 +0,0 @@ -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. - * - * 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; - /** - * 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::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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Dialogflow\V2\ConversationEvent_Type::class); - 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 deleted file mode 100644 index b4466ff047bc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100644 index 411295745a1d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php +++ /dev/null @@ -1,346 +0,0 @@ -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 = ''; - 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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $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. - * } - */ - 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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $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; - } - - /** - * @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 deleted file mode 100644 index e18b5e917760..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php +++ /dev/null @@ -1,64 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ModelType::class, \Google\Cloud\Dialogflow\V2\ConversationModel_ModelType::class); - 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 deleted file mode 100644 index fcfa0dcd49b4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php +++ /dev/null @@ -1,108 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Dialogflow\V2\ConversationModel_State::class); - 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 deleted file mode 100644 index a1a91b98b37c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php +++ /dev/null @@ -1,329 +0,0 @@ -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 tooks 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 tooks 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 tooks 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 tooks 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 deleted file mode 100644 index 64e096436091..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.dialogflow.v2.ConversationPhoneNumber - */ -class ConversationPhoneNumber extends \Google\Protobuf\Internal\Message -{ - /** - * 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 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. 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 deleted file mode 100644 index de1aedc1361f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php +++ /dev/null @@ -1,703 +0,0 @@ -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; - /** - * 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 = ''; - /** - * 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\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 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; - } - - /** - * 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; - } - - /** - * 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 deleted file mode 100644 index a68b43e00287..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 2ef96b057c10..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100644 index ebccff2c3948..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -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 deleted file mode 100644 index 1de934923f8f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php +++ /dev/null @@ -1,201 +0,0 @@ -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 deleted file mode 100644 index f4ccf021f2f8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php +++ /dev/null @@ -1,85 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata_State::class); - 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 deleted file mode 100644 index f1363b6bfb18..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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 deleted file mode 100644 index 3ec1f691d67a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php +++ /dev/null @@ -1,155 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index 798f8671039b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php +++ /dev/null @@ -1,94 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata_State::class); - 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 deleted file mode 100644 index bca3576d24f3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -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 deleted file mode 100644 index e6963cffd5f6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -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 deleted file mode 100644 index b27bde2a13f2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -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 fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. - * If the field is provided, the caller is resposible 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 fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. - * If the field is provided, the caller is resposible 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 fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. - * If the field is provided, the caller is resposible 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 fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. - * If the field is provided, the caller is resposible 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 deleted file mode 100644 index d642fc5392e8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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 deleted file mode 100644 index 54bd1e823b46..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php +++ /dev/null @@ -1,206 +0,0 @@ -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 deleted file mode 100644 index 44e1ccca9286..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -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/CreateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php deleted file mode 100644 index cb1644174e89..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php +++ /dev/null @@ -1,240 +0,0 @@ -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 deleted file mode 100644 index f46bccbd096b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -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 deleted file mode 100644 index 20b8f7fc2b7f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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 deleted file mode 100644 index 136ace21a71c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php +++ /dev/null @@ -1,153 +0,0 @@ -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/CreateVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php deleted file mode 100644 index d7797b86258d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateVersionRequest.php +++ /dev/null @@ -1,144 +0,0 @@ -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/DeleteAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php deleted file mode 100644 index a1e2bb7beea3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAgentRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100644 index 49e06cedaf16..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteAllContextsRequest.php +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100644 index 46b951b0a581..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteContextRequest.php +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100644 index 5fb0b3ce7894..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetOperationMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 27435f1e5011..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationDatasetRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 30cc0069d1d4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelOperationMetadata.php +++ /dev/null @@ -1,121 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index 03defafd52dc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationModelRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100644 index 232c89d32c16..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteConversationProfileRequest.php +++ /dev/null @@ -1,94 +0,0 @@ -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 deleted file mode 100644 index 1ae4fa249bdf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteDocumentRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 710ea199af0f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEntityTypeRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100644 index 4ff70b6dccd5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteEnvironmentRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -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/DeleteIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php deleted file mode 100644 index 6d9bcb459a3a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 7c1a9a71d578..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php +++ /dev/null @@ -1,130 +0,0 @@ -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 deleted file mode 100644 index e5a1c482bf1a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php +++ /dev/null @@ -1,112 +0,0 @@ -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/DeleteVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php deleted file mode 100644 index 2d813ed0f32f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100644 index fd4a874258f5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php +++ /dev/null @@ -1,121 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index 13c3d0a67d6d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100644 index 5d1b90f9edf2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php +++ /dev/null @@ -1,428 +0,0 @@ -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 deleted file mode 100644 index 8c07c511577f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php +++ /dev/null @@ -1,273 +0,0 @@ -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/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php deleted file mode 100644 index 74886da23f21..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php +++ /dev/null @@ -1,500 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 4e8437ac0670..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php +++ /dev/null @@ -1,85 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KnowledgeType::class, \Google\Cloud\Dialogflow\V2\Document_KnowledgeType::class); - 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 deleted file mode 100644 index d54cc82076fb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php +++ /dev/null @@ -1,132 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReloadStatus::class, \Google\Cloud\Dialogflow\V2\Document_ReloadStatus::class); - 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 deleted file mode 100644 index ec19452cb6b1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php +++ /dev/null @@ -1,85 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Dialogflow\V2\Document_State::class); - 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 deleted file mode 100644 index be68501e748b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php +++ /dev/null @@ -1,67 +0,0 @@ -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/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php deleted file mode 100644 index 2c3f5a2d924b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php +++ /dev/null @@ -1,274 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 77ac68085257..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php +++ /dev/null @@ -1,60 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AutoExpansionMode::class, \Google\Cloud\Dialogflow\V2\EntityType_AutoExpansionMode::class); - 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 deleted file mode 100644 index 80fe15446286..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php +++ /dev/null @@ -1,148 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSynonyms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->synonyms = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Entity::class, \Google\Cloud\Dialogflow\V2\EntityType_Entity::class); - 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 deleted file mode 100644 index 51d8c6f0d4e1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php +++ /dev/null @@ -1,75 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Kind::class, \Google\Cloud\Dialogflow\V2\EntityType_Kind::class); - 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 deleted file mode 100644 index 290c6bec564e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php +++ /dev/null @@ -1,67 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 89d14a767203..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php +++ /dev/null @@ -1,362 +0,0 @@ -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 deleted file mode 100644 index 6e41c7c1bc9b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php +++ /dev/null @@ -1,75 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Dialogflow\V2\Environment_State::class); - 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 deleted file mode 100644 index 103f60872d39..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php +++ /dev/null @@ -1,164 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EnvironmentHistory\Entry>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 4f71c3339858..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php +++ /dev/null @@ -1,148 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Entry::class, \Google\Cloud\Dialogflow\V2\EnvironmentHistory_Entry::class); - 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 deleted file mode 100644 index 316467a477c0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php +++ /dev/null @@ -1,142 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $datasets - * Required. Datasets used for evaluation. - * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartReplyConfig $smart_reply_config - * Configuration for smart reply model evalution. - * @type \Google\Cloud\Dialogflow\V2\EvaluationConfig\SmartComposeConfig $smart_compose_config - * Configuration for smart compose model evalution. - * } - */ - 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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\InputDataset>|\Google\Protobuf\Internal\RepeatedField $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 evalution. - * - * 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 evalution. - * - * 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 evalution. - * - * 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 evalution. - * - * 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 deleted file mode 100644 index 1dc54f0c1349..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php +++ /dev/null @@ -1,124 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SmartComposeConfig::class, \Google\Cloud\Dialogflow\V2\EvaluationConfig_SmartComposeConfig::class); - 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 deleted file mode 100644 index 81d493a47cd9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php +++ /dev/null @@ -1,124 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SmartReplyConfig::class, \Google\Cloud\Dialogflow\V2\EvaluationConfig_SmartReplyConfig::class); - 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 deleted file mode 100644 index fc4d095fa41d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php +++ /dev/null @@ -1,229 +0,0 @@ -` 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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 deleted file mode 100644 index 638f4e4b04ac..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 0568ef0c383c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100644 index 84bd5410682c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php +++ /dev/null @@ -1,194 +0,0 @@ -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 deleted file mode 100644 index 146257008327..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100644 index c8d2453ee36a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php +++ /dev/null @@ -1,269 +0,0 @@ -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/Fulfillment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php deleted file mode 100644 index 5284053b6d8f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php +++ /dev/null @@ -1,247 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Fulfillment\Feature>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 727ce7d8bfde..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php +++ /dev/null @@ -1,70 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Feature::class, \Google\Cloud\Dialogflow\V2\Fulfillment_Feature::class); - 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 deleted file mode 100644 index b516d100f4e8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php +++ /dev/null @@ -1,57 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Dialogflow\V2\Fulfillment_Feature_Type::class); - 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 deleted file mode 100644 index 3310056f4a7c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php +++ /dev/null @@ -1,236 +0,0 @@ -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() - { - @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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GenericWebService::class, \Google\Cloud\Dialogflow\V2\Fulfillment_GenericWebService::class); - 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 deleted file mode 100644 index d98f64a1385a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100644 index fd50c5a6fcdd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php +++ /dev/null @@ -1,75 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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/GenerateStatelessSummaryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php deleted file mode 100644 index a09c5be3763b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php +++ /dev/null @@ -1,222 +0,0 @@ -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; - /** - * 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.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 500 and at most 1000. - * - * Generated from protobuf field int32 max_context_size = 4; - */ - 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 - * 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 - * 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; - } - - /** - * 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.resource_reference) = { - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * 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.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 500 and at most 1000. - * - * Generated from protobuf field int32 max_context_size = 4; - * @return int - */ - public function getMaxContextSize() - { - return $this->max_context_size; - } - - /** - * 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; - * @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 deleted file mode 100644 index 076245af5307..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php +++ /dev/null @@ -1,125 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MinimalConversation::class, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest_MinimalConversation::class); - 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 deleted file mode 100644 index 81b03751852e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php +++ /dev/null @@ -1,166 +0,0 @@ -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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [GenerateStatelessSummaryRequest.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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [GenerateStatelessSummaryRequest.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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [GenerateStatelessSummaryRequest.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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [GenerateStatelessSummaryRequest.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 deleted file mode 100644 index 3fb0ebee15de..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php +++ /dev/null @@ -1,112 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Summary::class, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse_Summary::class); - 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 deleted file mode 100644 index 44a4bc873d9f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100644 index a41566ffa78c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100644 index 73859a70d1fb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 0f8ebc8d15eb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100644 index 675d2da7dc2a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100644 index 4670cd395f3a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 7046ac428ddd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 283f734009eb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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/GetEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php deleted file mode 100644 index 18edb8c6851c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100644 index 8df0e1890a1f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 286b2cd6e7ca..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -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 deleted file mode 100644 index fa37a6081b66..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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/GetIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php deleted file mode 100644 index 6767222f02d1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php +++ /dev/null @@ -1,192 +0,0 @@ -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 deleted file mode 100644 index 94d7edad9427..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index b9ab9c6df7ed..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index bcf3bf0e96ed..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php +++ /dev/null @@ -1,112 +0,0 @@ -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/GetValidationResultRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php deleted file mode 100644 index 67ee2984cfff..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -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 deleted file mode 100644 index 19dad18afb6f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100644 index 3a0c7664abc3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php +++ /dev/null @@ -1,217 +0,0 @@ -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 deleted file mode 100644 index 2a77bae7a69a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php +++ /dev/null @@ -1,138 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConversationModelConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_ConversationModelConfig::class); - 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 deleted file mode 100644 index 5aaf665a8da9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php +++ /dev/null @@ -1,74 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConversationProcessConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_ConversationProcessConfig::class); - 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 deleted file mode 100644 index 961e99d29168..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php +++ /dev/null @@ -1,196 +0,0 @@ -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; - - /** - * 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]. - * } - */ - 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MessageAnalysisConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_MessageAnalysisConfig::class); - 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 deleted file mode 100644 index 5a572f34db48..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php +++ /dev/null @@ -1,140 +0,0 @@ -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; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig>|\Google\Protobuf\Internal\RepeatedField $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. - * } - */ - 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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionFeatureConfig>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuggestionConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionConfig::class); - 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 deleted file mode 100644 index c1050336bb55..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php +++ /dev/null @@ -1,302 +0,0 @@ -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. - * - * Generated from protobuf field bool enable_event_based_suggestion = 3; - */ - protected $enable_event_based_suggestion = 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. - * @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. - * - * 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. - * - * 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; - } - - /** - * 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuggestionFeatureConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionFeatureConfig::class); - 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 deleted file mode 100644 index eddcc48c7c3f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php +++ /dev/null @@ -1,326 +0,0 @@ -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; - 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. - * } - */ - 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; - } - - /** - * @return string - */ - public function getQuerySource() - { - return $this->whichOneof("query_source"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuggestionQueryConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig::class); - 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 deleted file mode 100644 index dba5d8e3a3cb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php +++ /dev/null @@ -1,143 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContextFilterSettings::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_ContextFilterSettings::class); - 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 deleted file mode 100644 index 1cfc95c118b9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php +++ /dev/null @@ -1,83 +0,0 @@ -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 = ''; - - /** - * 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. - * } - */ - 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DialogflowQuerySource::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_DialogflowQuerySource::class); - 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 deleted file mode 100644 index fc256b2de3e4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php +++ /dev/null @@ -1,83 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->documents = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DocumentQuerySource::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_DocumentQuerySource::class); - 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 deleted file mode 100644 index c525c1941b75..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php +++ /dev/null @@ -1,83 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKnowledgeBases($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->knowledge_bases = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KnowledgeBaseQuerySource::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_KnowledgeBaseQuerySource::class); - 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 deleted file mode 100644 index c53a6921ed42..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php +++ /dev/null @@ -1,108 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuggestionTriggerSettings::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionTriggerSettings::class); - 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 deleted file mode 100644 index 61331a7dc1e6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php +++ /dev/null @@ -1,148 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 63924ddc8d81..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100644 index 6e6f2dac5c30..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php +++ /dev/null @@ -1,74 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LivePersonConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig_LivePersonConfig::class); - 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 deleted file mode 100644 index 8bc5641bf77b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php +++ /dev/null @@ -1,184 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SalesforceLiveAgentConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentHandoffConfig_SalesforceLiveAgentConfig::class); - 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 deleted file mode 100644 index 6c0b27e42f2d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100644 index fd0fdeede7ef..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 9e946c081918..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100644 index 4dbfc9178c1c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -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 deleted file mode 100644 index 674d0140d28e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php +++ /dev/null @@ -1,147 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index a0ead26c3808..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php +++ /dev/null @@ -1,212 +0,0 @@ -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 deleted file mode 100644 index 98f7b7ae4fa6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $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/InputAudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php deleted file mode 100644 index 96d1adff0ab5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php +++ /dev/null @@ -1,624 +0,0 @@ -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; - */ - 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; - */ - 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. - * - * Generated from protobuf field string language_code = 3; - */ - 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; - /** - * Which Speech model to select for the given request. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then we auto-select a model based on the parameters - * in the InputAudioConfig. - * 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 (best for very short utterances and commands) - * - * 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; - - /** - * 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. - * @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 array|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $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 - * Which Speech model to select for the given request. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then we auto-select a model based on the parameters - * in the InputAudioConfig. - * 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 (best for very short utterances and commands) - * @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. - * } - */ - 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; - * @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; - * @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; - * @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; - * @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. - * - * Generated from protobuf field string language_code = 3; - * @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. - * - * Generated from protobuf field string language_code = 3; - * @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 \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getPhraseHints() - { - @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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setPhraseHints($var) - { - @trigger_error('phrase_hints is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $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; - } - - /** - * Which Speech model to select for the given request. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then we auto-select a model based on the parameters - * in the InputAudioConfig. - * 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 (best for very short utterances and commands) - * - * Generated from protobuf field string model = 7; - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Which Speech model to select for the given request. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then we auto-select a model based on the parameters - * in the InputAudioConfig. - * 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 (best for very short utterances and commands) - * - * 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; - } - -} - 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 deleted file mode 100644 index eb1a43005e84..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php +++ /dev/null @@ -1,82 +0,0 @@ -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 deleted file mode 100644 index 28917cda63a8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100644 index 13adbca24087..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100644 index 2fdd45834dc7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php +++ /dev/null @@ -1,904 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $input_context_names - * Optional. The list of context names required for this intent to be - * triggered. - * Format: `projects//agent/sessions/-/contexts/`. - * @type array|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Intent\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters - * Optional. The collection of parameters associated with the intent. - * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $messages - * Optional. The collection of rich messages corresponding to the - * `Response` field in the Dialogflow console. - * @type array|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Parameter>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index b7cf0d145f19..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php +++ /dev/null @@ -1,112 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FollowupIntentInfo::class, \Google\Cloud\Dialogflow\V2\Intent_FollowupIntentInfo::class); - 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 deleted file mode 100644 index 3c509bed6783..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php +++ /dev/null @@ -1,545 +0,0 @@ -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"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Message::class, \Google\Cloud\Dialogflow\V2\Intent_Message::class); - 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 deleted file mode 100644 index 8b505949bd21..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php +++ /dev/null @@ -1,216 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BasicCard::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BasicCard::class); - 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 deleted file mode 100644 index 373c09363fe4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php +++ /dev/null @@ -1,114 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Button::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BasicCard_Button::class); - 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 deleted file mode 100644 index e993a7466cb9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php +++ /dev/null @@ -1,70 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OpenUriAction::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BasicCard_Button_OpenUriAction::class); - 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 deleted file mode 100644 index 9d3fbc34d12c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php +++ /dev/null @@ -1,113 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BrowseCarouselCard\BrowseCarouselCardItem>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BrowseCarouselCard::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard::class); - 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 deleted file mode 100644 index 7fba0b85fae1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php +++ /dev/null @@ -1,234 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(BrowseCarouselCardItem::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_BrowseCarouselCardItem::class); - 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 deleted file mode 100644 index 71febe611d3b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php +++ /dev/null @@ -1,108 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OpenUrlAction::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_BrowseCarouselCardItem_OpenUrlAction::class); - 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 deleted file mode 100644 index cd19ba04e43f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php +++ /dev/null @@ -1,65 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UrlTypeHint::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_BrowseCarouselCardItem_OpenUrlAction_UrlTypeHint::class); - 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 deleted file mode 100644 index 3edd8f5a6dae..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php +++ /dev/null @@ -1,89 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ImageDisplayOptions::class, \Google\Cloud\Dialogflow\V2\Intent_Message_BrowseCarouselCard_ImageDisplayOptions::class); - 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 deleted file mode 100644 index 398ec1eb5c22..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php +++ /dev/null @@ -1,172 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Card\Button>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Card::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Card::class); - 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 deleted file mode 100644 index 615e2785bb4d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php +++ /dev/null @@ -1,108 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Button::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Card_Button::class); - 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 deleted file mode 100644 index 3f46c5e840ab..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php +++ /dev/null @@ -1,70 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\CarouselSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CarouselSelect::class, \Google\Cloud\Dialogflow\V2\Intent_Message_CarouselSelect::class); - 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 deleted file mode 100644 index a221fe59073c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php +++ /dev/null @@ -1,192 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Item::class, \Google\Cloud\Dialogflow\V2\Intent_Message_CarouselSelect_Item::class); - 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 deleted file mode 100644 index dd3d274a8f2f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php +++ /dev/null @@ -1,105 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ColumnProperties::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ColumnProperties::class); - 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 deleted file mode 100644 index 96cec8e9be4d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php +++ /dev/null @@ -1,71 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HorizontalAlignment::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ColumnProperties_HorizontalAlignment::class); - 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 deleted file mode 100644 index 1673b84f25f5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php +++ /dev/null @@ -1,108 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Image::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Image::class); - 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 deleted file mode 100644 index 6f6730cea584..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php +++ /dev/null @@ -1,109 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LinkOutSuggestion::class, \Google\Cloud\Dialogflow\V2\Intent_Message_LinkOutSuggestion::class); - 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 deleted file mode 100644 index bbfef362bc0e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php +++ /dev/null @@ -1,138 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ListSelect\Item>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ListSelect::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ListSelect::class); - 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 deleted file mode 100644 index fcc7d6847ad5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php +++ /dev/null @@ -1,192 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Item::class, \Google\Cloud\Dialogflow\V2\Intent_Message_ListSelect_Item::class); - 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 deleted file mode 100644 index d5430281c7de..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php +++ /dev/null @@ -1,104 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\MediaContent\ResponseMediaObject>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MediaContent::class, \Google\Cloud\Dialogflow\V2\Intent_Message_MediaContent::class); - 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 deleted file mode 100644 index 59de16e065f6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php +++ /dev/null @@ -1,213 +0,0 @@ -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"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResponseMediaObject::class, \Google\Cloud\Dialogflow\V2\Intent_Message_MediaContent_ResponseMediaObject::class); - 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 deleted file mode 100644 index 7ff8438d6ca1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php +++ /dev/null @@ -1,57 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResponseMediaType::class, \Google\Cloud\Dialogflow\V2\Intent_Message_MediaContent_ResponseMediaType::class); - 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 deleted file mode 100644 index 5da4a44f1522..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php +++ /dev/null @@ -1,116 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Platform::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Platform::class); - 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 deleted file mode 100644 index a3d54844bfad..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php +++ /dev/null @@ -1,104 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQuickReplies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->quick_replies = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QuickReplies::class, \Google\Cloud\Dialogflow\V2\Intent_Message_QuickReplies::class); - 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 deleted file mode 100644 index 615e0f22fe57..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php +++ /dev/null @@ -1,113 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSynonyms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->synonyms = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SelectItemInfo::class, \Google\Cloud\Dialogflow\V2\Intent_Message_SelectItemInfo::class); - 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 deleted file mode 100644 index e59d4ce2bbe5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php +++ /dev/null @@ -1,150 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SimpleResponse::class, \Google\Cloud\Dialogflow\V2\Intent_Message_SimpleResponse::class); - 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 deleted file mode 100644 index a8d1e0095b9f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php +++ /dev/null @@ -1,73 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\SimpleResponse>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SimpleResponses::class, \Google\Cloud\Dialogflow\V2\Intent_Message_SimpleResponses::class); - 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 deleted file mode 100644 index f5e643dcb598..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php +++ /dev/null @@ -1,71 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Suggestion::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Suggestion::class); - 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 deleted file mode 100644 index 49ac588ee861..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php +++ /dev/null @@ -1,70 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\Suggestion>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Suggestions::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Suggestions::class); - 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 deleted file mode 100644 index daffa040dbc6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php +++ /dev/null @@ -1,250 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties>|\Google\Protobuf\Internal\RepeatedField $column_properties - * Optional. Display properties for the columns in this table. - * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow>|\Google\Protobuf\Internal\RepeatedField $rows - * Optional. Rows in this table of data. - * @type array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardRow>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\BasicCard\Button>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TableCard::class, \Google\Cloud\Dialogflow\V2\Intent_Message_TableCard::class); - 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 deleted file mode 100644 index 80fa26fc55a0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php +++ /dev/null @@ -1,71 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TableCardCell::class, \Google\Cloud\Dialogflow\V2\Intent_Message_TableCardCell::class); - 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 deleted file mode 100644 index faffa5e21573..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php +++ /dev/null @@ -1,104 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message\TableCardCell>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TableCardRow::class, \Google\Cloud\Dialogflow\V2\Intent_Message_TableCardRow::class); - 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 deleted file mode 100644 index 238bb805c106..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php +++ /dev/null @@ -1,70 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setText($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->text = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Text::class, \Google\Cloud\Dialogflow\V2\Intent_Message_Text::class); - 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 deleted file mode 100644 index dd13566fb368..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php +++ /dev/null @@ -1,360 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Parameter::class, \Google\Cloud\Dialogflow\V2\Intent_Parameter::class); - 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 deleted file mode 100644 index bb0045425c23..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php +++ /dev/null @@ -1,240 +0,0 @@ -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; - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part>|\Google\Protobuf\Internal\RepeatedField $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; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique identifier of this training phrase. - * - * 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 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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TrainingPhrase::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase::class); - 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 deleted file mode 100644 index 4f319d65101f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php +++ /dev/null @@ -1,196 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Part::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase_Part::class); - 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 deleted file mode 100644 index a0a5ef200c1e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php +++ /dev/null @@ -1,70 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase_Type::class); - 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 deleted file mode 100644 index 7282b5d28d99..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php +++ /dev/null @@ -1,65 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(WebhookState::class, \Google\Cloud\Dialogflow\V2\Intent_WebhookState::class); - 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 deleted file mode 100644 index 87fcc6a533c2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php +++ /dev/null @@ -1,67 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - public function getIntents() - { - return $this->intents; - } - - /** - * A collection of intents. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent intents = 1; - * @param array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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/IntentView.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php deleted file mode 100644 index 916e50e6b7db..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php +++ /dev/null @@ -1,56 +0,0 @@ -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/KnowledgeBase.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php deleted file mode 100644 index d3753cd6ed8c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeBase.php +++ /dev/null @@ -1,166 +0,0 @@ -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 deleted file mode 100644 index 609ea56307cb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata.php +++ /dev/null @@ -1,143 +0,0 @@ -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 = ''; - 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. - * } - */ - 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; - } - - /** - * @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 deleted file mode 100644 index ea9235bbaf4f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeOperationMetadata/State.php +++ /dev/null @@ -1,71 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata_State::class); - 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 deleted file mode 100644 index e0f875e09140..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsRequest.php +++ /dev/null @@ -1,231 +0,0 @@ -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. - * Marked deprecated as it hasn't been, and isn't currently, supported. - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - 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. - * Marked deprecated as it hasn't been, and isn't currently, supported. - * 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. - * Marked deprecated as it hasn't been, and isn't currently, supported. - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getFilter() - { - @trigger_error('filter is deprecated.', E_USER_DEPRECATED); - return $this->filter; - } - - /** - * Optional. Filters to restrict results to specific answer records. - * Marked deprecated as it hasn't been, and isn't currently, supported. - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setFilter($var) - { - @trigger_error('filter is deprecated.', E_USER_DEPRECATED); - 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 deleted file mode 100644 index f15328a1c8e0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListAnswerRecordsResponse.php +++ /dev/null @@ -1,122 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\AnswerRecord>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\AnswerRecord>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 3b9d788cdac3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsRequest.php +++ /dev/null @@ -1,179 +0,0 @@ -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 deleted file mode 100644 index 4441573223fb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListContextsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 7647f1d40cdb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -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 deleted file mode 100644 index 5e091819a336..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationDatasetsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\ConversationDataset>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\ConversationDataset>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 759979e24616..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100644 index f9742668b66b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelEvaluationsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 286fcf7c12df..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100644 index 1aa84fbac746..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationModelsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\ConversationModel>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\ConversationModel>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 71d9fdd37529..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -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 deleted file mode 100644 index b0a8719d5b62..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationProfilesResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\ConversationProfile>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\ConversationProfile>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 7b32a8e83c0f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php +++ /dev/null @@ -1,249 +0,0 @@ -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 = ''; - /** - * A filter expression that filters conversations listed in the response. In - * general, the expression must specify the field name, a comparison operator, - * and the value to use for filtering: - *
    - *
  • The value must be a string, a number, or a boolean.
  • - *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • - *
  • To filter on multiple expressions, separate the - * expressions with `AND` or `OR` (omitting both implies `AND`).
  • - *
  • For clarity, expressions can be enclosed in parentheses.
  • - *
- * 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; - */ - 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 - * A filter expression that filters conversations listed in the response. In - * general, the expression must specify the field name, a comparison operator, - * and the value to use for filtering: - *
    - *
  • The value must be a string, a number, or a boolean.
  • - *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • - *
  • To filter on multiple expressions, separate the - * expressions with `AND` or `OR` (omitting both implies `AND`).
  • - *
  • For clarity, expressions can be enclosed in parentheses.
  • - *
- * 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; - } - - /** - * A filter expression that filters conversations listed in the response. In - * general, the expression must specify the field name, a comparison operator, - * and the value to use for filtering: - *
    - *
  • The value must be a string, a number, or a boolean.
  • - *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • - *
  • To filter on multiple expressions, separate the - * expressions with `AND` or `OR` (omitting both implies `AND`).
  • - *
  • For clarity, expressions can be enclosed in parentheses.
  • - *
- * 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; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A filter expression that filters conversations listed in the response. In - * general, the expression must specify the field name, a comparison operator, - * and the value to use for filtering: - *
    - *
  • The value must be a string, a number, or a boolean.
  • - *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • - *
  • To filter on multiple expressions, separate the - * expressions with `AND` or `OR` (omitting both implies `AND`).
  • - *
  • For clarity, expressions can be enclosed in parentheses.
  • - *
- * 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; - * @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 deleted file mode 100644 index f4a0679ed9e2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Conversation>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Conversation>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index ca75b931de79..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsRequest.php +++ /dev/null @@ -1,254 +0,0 @@ -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 deleted file mode 100644 index 101cf40d5b81..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListDocumentsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Document>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - public function getDocuments() - { - return $this->documents; - } - - /** - * The list of documents. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Document documents = 1; - * @param array<\Google\Cloud\Dialogflow\V2\Document>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index a24d189e03ca..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesRequest.php +++ /dev/null @@ -1,230 +0,0 @@ -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 deleted file mode 100644 index 766d0263fd6d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEntityTypesResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 9cb3ad81189c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -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 deleted file mode 100644 index c5fe88b95df4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListEnvironmentsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Environment>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Environment>|\Google\Protobuf\Internal\RepeatedField $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/ListIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php deleted file mode 100644 index 67abb03cce5d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php +++ /dev/null @@ -1,308 +0,0 @@ -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 deleted file mode 100644 index 8d1fe4c0ff55..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 5fba54aff400..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php +++ /dev/null @@ -1,265 +0,0 @@ -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 deleted file mode 100644 index 89838ab5d1fa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\KnowledgeBase>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\KnowledgeBase>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index bb73b25f182f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php +++ /dev/null @@ -1,222 +0,0 @@ -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 deleted file mode 100644 index 694488dc89b7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php +++ /dev/null @@ -1,114 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Message>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index ac01cf2d0931..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -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 deleted file mode 100644 index 800b88ac62f5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Participant>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Participant>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index e178b686b17e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php +++ /dev/null @@ -1,179 +0,0 @@ -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 deleted file mode 100644 index 87ea45ce09d7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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/ListVersionsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php deleted file mode 100644 index be9c3192b649..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -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 deleted file mode 100644 index 653aa7dedfdc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Version>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Version>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 31121f0f3ed8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100644 index a176cd042024..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php +++ /dev/null @@ -1,395 +0,0 @@ -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. - * - * 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. - * @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. - * - * 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. - * - * 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 deleted file mode 100644 index d1860e5293c1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\AnnotatedMessagePart>|\Google\Protobuf\Internal\RepeatedField $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/NotificationConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php deleted file mode 100644 index f096ff33fdbb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php +++ /dev/null @@ -1,149 +0,0 @@ -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 deleted file mode 100644 index fac3e1d43f9f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php +++ /dev/null @@ -1,64 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MessageFormat::class, \Google\Cloud\Dialogflow\V2\NotificationConfig_MessageFormat::class); - 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 deleted file mode 100644 index 3522f20bf36d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php +++ /dev/null @@ -1,202 +0,0 @@ -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 deleted file mode 100644 index 33828b7f28cb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php +++ /dev/null @@ -1,115 +0,0 @@ -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 deleted file mode 100644 index 0380436645b2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php +++ /dev/null @@ -1,163 +0,0 @@ -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 deleted file mode 100644 index b8821bce4def..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php +++ /dev/null @@ -1,86 +0,0 @@ -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 32kbps. - * - * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MP3 = 2; - */ - 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; - - 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', - ]; - - 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 deleted file mode 100644 index a569536d5160..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php +++ /dev/null @@ -1,387 +0,0 @@ -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. - * 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; - - /** - * 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. - * 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" - * } - * ``` - * } - */ - 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. - * 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. - * 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; - } - -} - 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 deleted file mode 100644 index f2fe378e35fe..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/Role.php +++ /dev/null @@ -1,72 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Role::class, \Google\Cloud\Dialogflow\V2\Participant_Role::class); - 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 deleted file mode 100644 index dcb659ad299e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryInput.php +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100644 index f6469b8c6266..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php +++ /dev/null @@ -1,415 +0,0 @@ -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; - - /** - * 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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. - * } - */ - 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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - 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 deleted file mode 100644 index f78289af3d1b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php +++ /dev/null @@ -1,855 +0,0 @@ -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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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: map - * - Else: depending on parameter value type, could be one of string, - * number, boolean, null, list or map - * - MapValue value: - * - If parameter's entity type is a composite entity: - * map from composite entity property names to property values - * - Else: 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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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/ReloadDocumentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php deleted file mode 100644 index ea0bbfeabba2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ReloadDocumentRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -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 deleted file mode 100644 index 19fa9863b9cd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/RestoreAgentRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100644 index 07a85234cbb0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -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 deleted file mode 100644 index 65b54935d344..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchAgentsResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Agent>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Agent>|\Google\Protobuf\Internal\RepeatedField $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/Sentiment.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php deleted file mode 100644 index 2fb6df49acb2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100644 index 996d88c8c1f7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100644 index a6e582c0eafb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php +++ /dev/null @@ -1,89 +0,0 @@ -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/SessionEntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php deleted file mode 100644 index 2e6fedf0262d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType.php +++ /dev/null @@ -1,181 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\EntityType\Entity>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 7d3d5edc239d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SessionEntityType/EntityOverrideMode.php +++ /dev/null @@ -1,73 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EntityOverrideMode::class, \Google\Cloud\Dialogflow\V2\SessionEntityType_EntityOverrideMode::class); - 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 deleted file mode 100644 index 89ce4e6b5087..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetAgentRequest.php +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100644 index 72ad8f5015e9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigOperationMetadata.php +++ /dev/null @@ -1,192 +0,0 @@ -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 deleted file mode 100644 index 1dd6d9099643..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SetSuggestionFeatureConfigRequest.php +++ /dev/null @@ -1,194 +0,0 @@ -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/SmartReplyAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php deleted file mode 100644 index 3a2493d155e0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyAnswer.php +++ /dev/null @@ -1,155 +0,0 @@ -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 deleted file mode 100644 index b191f64c4706..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics.php +++ /dev/null @@ -1,143 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SmartReplyMetrics\TopNMetrics>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index eb1c7e7530cf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyMetrics/TopNMetrics.php +++ /dev/null @@ -1,124 +0,0 @@ -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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TopNMetrics::class, \Google\Cloud\Dialogflow\V2\SmartReplyMetrics_TopNMetrics::class); - 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 deleted file mode 100644 index 5de43743665a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SmartReplyModelMetadata.php +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100644 index 07a14528011f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php +++ /dev/null @@ -1,162 +0,0 @@ -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; - */ - 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; - */ - protected $boost = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $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; - * @return \Google\Protobuf\Internal\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; - * @param array|\Google\Protobuf\Internal\RepeatedField $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; - * @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; - * @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 deleted file mode 100644 index ea10fcdb7041..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php +++ /dev/null @@ -1,92 +0,0 @@ -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][InputAudioConfig.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 deleted file mode 100644 index 0015c8fb766a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php +++ /dev/null @@ -1,158 +0,0 @@ -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 a default - * model is used. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * - * Generated from protobuf field string model = 2; - */ - protected $model = ''; - - /** - * 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 a default - * model is used. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * } - */ - 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 a default - * model is used. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * - * 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 a default - * model is used. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * - * 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; - } - -} - 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 deleted file mode 100644 index 6070b604df91..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php +++ /dev/null @@ -1,225 +0,0 @@ -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 deleted file mode 100644 index 2508c1bc6e5e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SsmlVoiceGender.php +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100644 index c68a5c69e606..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php +++ /dev/null @@ -1,603 +0,0 @@ -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; - /** - * Enable partial virtual agent responses. If this flag is not enabled, - * response stream still contains only one final response even if some - * `Fulfillment`s in Dialogflow virtual agent have been configured to return - * partial responses. - * - * Generated from protobuf field bool enable_partial_automated_agent_reply = 12; - */ - protected $enable_partial_automated_agent_reply = 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. - * @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_partial_automated_agent_reply - * Enable partial virtual agent responses. If this flag is not enabled, - * response stream still contains only one final response even if some - * `Fulfillment`s in Dialogflow virtual agent have been configured to return - * partial responses. - * @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. - * - * 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. - * - * 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; - } - - /** - * Enable partial virtual agent responses. If this flag is not enabled, - * response stream still contains only one final response even if some - * `Fulfillment`s in Dialogflow virtual agent have been configured to return - * partial responses. - * - * Generated from protobuf field bool enable_partial_automated_agent_reply = 12; - * @return bool - */ - public function getEnablePartialAutomatedAgentReply() - { - return $this->enable_partial_automated_agent_reply; - } - - /** - * Enable partial virtual agent responses. If this flag is not enabled, - * response stream still contains only one final response even if some - * `Fulfillment`s in Dialogflow virtual agent have been configured to return - * partial responses. - * - * Generated from protobuf field bool enable_partial_automated_agent_reply = 12; - * @param bool $var - * @return $this - */ - public function setEnablePartialAutomatedAgentReply($var) - { - GPBUtil::checkBool($var); - $this->enable_partial_automated_agent_reply = $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 deleted file mode 100644 index f42c757ab81a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentResponse.php +++ /dev/null @@ -1,500 +0,0 @@ -= 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; - /** - * Only set if a Dialogflow automated agent has responded. - * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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; - - /** - * 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 - * Only set if a Dialogflow automated agent has responded. - * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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. - * } - */ - 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; - } - - /** - * Only set if a Dialogflow automated agent has responded. - * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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); - } - - /** - * Only set if a Dialogflow automated agent has responded. - * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] - * and [AutomatedAgentReply.detect_intent_response.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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SuggestionResult>|\Google\Protobuf\Internal\RepeatedField $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; - } - -} - 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 deleted file mode 100644 index 2644d3ed9582..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentRequest.php +++ /dev/null @@ -1,522 +0,0 @@ -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() - { - @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 deleted file mode 100644 index c20491319563..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingDetectIntentResponse.php +++ /dev/null @@ -1,371 +0,0 @@ -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` 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` 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` 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` 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 deleted file mode 100644 index 705e93ee6d6d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult.php +++ /dev/null @@ -1,363 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\SpeechWordInfo>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SpeechWordInfo>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index f67361b923ee..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingRecognitionResult/MessageType.php +++ /dev/null @@ -1,71 +0,0 @@ -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; - /** - * 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MessageType::class, \Google\Cloud\Dialogflow\V2\StreamingRecognitionResult_MessageType::class); - 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 deleted file mode 100644 index aa503b51f5d2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesRequest.php +++ /dev/null @@ -1,228 +0,0 @@ -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 deleted file mode 100644 index 3d9372203970..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestArticlesResponse.php +++ /dev/null @@ -1,168 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\ArticleAnswer>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\ArticleAnswer>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 0a4865b71466..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php +++ /dev/null @@ -1,228 +0,0 @@ -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 = ''; - /** - * 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.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 500 and at most 1000. - * - * Generated from protobuf field int32 context_size = 4; - */ - protected $context_size = 0; - /** - * 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; - */ - 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 - * 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 - * 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 - * 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; - } - - /** - * 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.resource_reference) = { - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * 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.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 500 and at most 1000. - * - * Generated from protobuf field int32 context_size = 4; - * @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 500 and at most 1000. - * - * Generated from protobuf field int32 context_size = 4; - * @param int $var - * @return $this - */ - public function setContextSize($var) - { - GPBUtil::checkInt32($var); - $this->context_size = $var; - - return $this; - } - - /** - * 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; - * @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. Only used for POC/demo purpose. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5; - * @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 deleted file mode 100644 index 168c11a1ae16..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php +++ /dev/null @@ -1,170 +0,0 @@ -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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [SuggestSummaryRequest.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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [SuggestSummaryRequest.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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [SuggestSummaryRequest.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 - * [last_conversation_message][] used to compile the suggestion. It may be - * smaller than the [SuggestSummaryRequest.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 deleted file mode 100644 index 8d14399a6a6a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php +++ /dev/null @@ -1,150 +0,0 @@ -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; - /** - * The name of the answer record. Format: - * "projects//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 $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 $answer_record - * The name of the answer record. Format: - * "projects//answerRecords/" - * } - */ - 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; - } - - /** - * 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Summary::class, \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse_Summary::class); - 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 deleted file mode 100644 index 78582705f831..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersRequest.php +++ /dev/null @@ -1,224 +0,0 @@ -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 deleted file mode 100644 index 2dc230acbb62..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestFaqAnswersResponse.php +++ /dev/null @@ -1,168 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\FaqAnswer>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\FaqAnswer>|\Google\Protobuf\Internal\RepeatedField $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/SuggestSmartRepliesRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php deleted file mode 100644 index 3849f06f4560..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php +++ /dev/null @@ -1,232 +0,0 @@ -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 deleted file mode 100644 index 0938283c9e61..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php +++ /dev/null @@ -1,176 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SmartReplyAnswer>|\Google\Protobuf\Internal\RepeatedField $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/SuggestionFeature.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php deleted file mode 100644 index f04dab6d457f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100644 index fcc8a5082701..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php +++ /dev/null @@ -1,71 +0,0 @@ -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; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', - self::FAQ => 'FAQ', - self::SMART_REPLY => '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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Dialogflow\V2\SuggestionFeature_Type::class); - 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 deleted file mode 100644 index 1adc8b87646b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php +++ /dev/null @@ -1,180 +0,0 @@ -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\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. - * } - */ - 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; - } - - /** - * 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; - } - - /** - * @return string - */ - public function getSuggestionResponse() - { - return $this->whichOneof("suggestion_response"); - } - -} - 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 deleted file mode 100644 index d9426069bf0f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php +++ /dev/null @@ -1,269 +0,0 @@ -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; - */ - 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; - */ - 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; - */ - 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; - */ - private $effects_profile_id; - /** - * Optional. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4; - */ - protected $voice = null; - - /** - * 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 array|\Google\Protobuf\Internal\RepeatedField $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. - * } - */ - 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; - * @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; - * @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; - * @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; - * @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; - * @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; - * @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; - * @return \Google\Protobuf\Internal\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; - * @param array|\Google\Protobuf\Internal\RepeatedField $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; - * @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; - * @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; - } - -} - 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 deleted file mode 100644 index c647551cae30..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index ad3a6c6a3f14..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php +++ /dev/null @@ -1,67 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index c9836cc74f9c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php +++ /dev/null @@ -1,119 +0,0 @@ -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 deleted file mode 100644 index ab020b9a6dfa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php +++ /dev/null @@ -1,197 +0,0 @@ -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/TrainAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php deleted file mode 100644 index 0f5f6c52b0ba..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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/UndeployConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php deleted file mode 100644 index 95fe6f8dccd8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php +++ /dev/null @@ -1,121 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index fcc391de050b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100644 index a70cc658fdb4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -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 deleted file mode 100644 index e8e4bb8d3a27..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -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 deleted file mode 100644 index 3d1cf1959ca4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -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 deleted file mode 100644 index a7ed1d635a42..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -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 deleted file mode 100644 index 0af3206ffb0c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php +++ /dev/null @@ -1,204 +0,0 @@ -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 deleted file mode 100644 index de77205bc8d5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php +++ /dev/null @@ -1,168 +0,0 @@ -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 deleted file mode 100644 index 3688f9f4baf7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -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/UpdateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php deleted file mode 100644 index 0d2f04dd54a0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php +++ /dev/null @@ -1,246 +0,0 @@ -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 deleted file mode 100644 index 827f8ac4c2d2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -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 deleted file mode 100644 index 75d3294f105a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -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 deleted file mode 100644 index 27308cf6c376..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php +++ /dev/null @@ -1,150 +0,0 @@ -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/UpdateVersionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php deleted file mode 100644 index a5327be9b4bd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100644 index a9216f15ccb6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php +++ /dev/null @@ -1,183 +0,0 @@ -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 array|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\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 array|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 893aa5c46a19..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php +++ /dev/null @@ -1,78 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Severity::class, \Google\Cloud\Dialogflow\V2\ValidationError_Severity::class); - 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 deleted file mode 100644 index 2ccd637af70a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php +++ /dev/null @@ -1,67 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\ValidationError>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\ValidationError>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 8e7a86fa5836..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php +++ /dev/null @@ -1,254 +0,0 @@ -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 deleted file mode 100644 index cafb8c2f098b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php +++ /dev/null @@ -1,71 +0,0 @@ -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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VersionStatus::class, \Google\Cloud\Dialogflow\V2\Version_VersionStatus::class); - 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 deleted file mode 100644 index 762f054c7ec1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php +++ /dev/null @@ -1,129 +0,0 @@ -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; - */ - 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; - */ - 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; - * @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; - * @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; - * @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; - * @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 deleted file mode 100644 index e00b19da7256..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php +++ /dev/null @@ -1,217 +0,0 @@ -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 deleted file mode 100644 index df629dd7b5f3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php +++ /dev/null @@ -1,430 +0,0 @@ -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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Intent\Message>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\Context>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField - */ - 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 array<\Google\Cloud\Dialogflow\V2\SessionEntityType>|\Google\Protobuf\Internal\RepeatedField $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 deleted file mode 100644 index 6a566c87c5b5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php +++ /dev/null @@ -1,65 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function delete_agent_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - $agentsClient->deleteAgent($formattedParent); - 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 deleted file mode 100644 index aa0b05ec1335..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php +++ /dev/null @@ -1,99 +0,0 @@ -`. 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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->exportAgent($formattedParent, $agentUri); - $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 deleted file mode 100644 index 50c7f1b26a0d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php +++ /dev/null @@ -1,67 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function get_agent_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - /** @var Agent $response */ - $response = $agentsClient->getAgent($formattedParent); - 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 deleted file mode 100644 index 31f5636f0173..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 0aeae9968fb0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php +++ /dev/null @@ -1,68 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function get_validation_result_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - /** @var ValidationResult $response */ - $response = $agentsClient->getValidationResult($formattedParent); - 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 deleted file mode 100644 index c810d6d346c1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php +++ /dev/null @@ -1,102 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function import_agent_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->importAgent($formattedParent); - $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 deleted file mode 100644 index c1a90db03466..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 2576c7a2ccc6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php +++ /dev/null @@ -1,100 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function restore_agent_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->restoreAgent($formattedParent); - $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 deleted file mode 100644 index 69eeaff5244e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php +++ /dev/null @@ -1,78 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function search_agents_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $agentsClient->searchAgents($formattedParent); - - /** @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 deleted file mode 100644 index a4149c56d3d7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php +++ /dev/null @@ -1,99 +0,0 @@ -`. 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 any non-scalar elements to be passed along with the request. - $agent = (new Agent()) - ->setParent($formattedAgentParent) - ->setDisplayName($agentDisplayName) - ->setDefaultLanguageCode($agentDefaultLanguageCode) - ->setTimeZone($agentTimeZone); - - // Call the API and handle any network failures. - try { - /** @var Agent $response */ - $response = $agentsClient->setAgent($agent); - 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 deleted file mode 100644 index 52e6ece194ac..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php +++ /dev/null @@ -1,89 +0,0 @@ -`. Please see - * {@see AgentsClient::projectName()} for help formatting this field. - */ -function train_agent_sample(string $formattedParent): void -{ - // Create a client. - $agentsClient = new AgentsClient(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->trainAgent($formattedParent); - $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 deleted file mode 100644 index 4c45237cb172..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 383b871f120b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php +++ /dev/null @@ -1,74 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $answerRecordsClient->listAnswerRecords($formattedParent); - - /** @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 deleted file mode 100644 index 67f38d2cc8fc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index dbb982702e80..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php +++ /dev/null @@ -1,61 +0,0 @@ -setAnswerFeedback($answerRecordAnswerFeedback); - $updateMask = new FieldMask(); - - // Call the API and handle any network failures. - try { - /** @var AnswerRecord $response */ - $response = $answerRecordsClient->updateAnswerRecord($answerRecord, $updateMask); - 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 deleted file mode 100644 index f34d47416957..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php +++ /dev/null @@ -1,95 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $context = (new Context()) - ->setName($contextName); - - // Call the API and handle any network failures. - try { - /** @var Context $response */ - $response = $contextsClient->createContext($formattedParent, $context); - 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 deleted file mode 100644 index 9943ce9523ac..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php +++ /dev/null @@ -1,69 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $contextsClient->deleteAllContexts($formattedParent); - 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 deleted file mode 100644 index 9139cff88fab..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php +++ /dev/null @@ -1,69 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $contextsClient->deleteContext($formattedName); - 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 deleted file mode 100644 index 327dd437a96f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php +++ /dev/null @@ -1,71 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Context $response */ - $response = $contextsClient->getContext($formattedName); - 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 deleted file mode 100644 index 1e34a3e5b84b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 156c35a9edf3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php +++ /dev/null @@ -1,76 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $contextsClient->listContexts($formattedParent); - - /** @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 deleted file mode 100644 index b0269323ae6f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 02496e0818b3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php +++ /dev/null @@ -1,85 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $context = (new Context()) - ->setName($contextName); - - // Call the API and handle any network failures. - try { - /** @var Context $response */ - $response = $contextsClient->updateContext($context); - 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 deleted file mode 100644 index bd0bf6bf824c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php +++ /dev/null @@ -1,95 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $conversationDataset = (new ConversationDataset()) - ->setDisplayName($conversationDatasetDisplayName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); - $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 deleted file mode 100644 index a7ca14130f04..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php +++ /dev/null @@ -1,90 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationDatasetsClient->deleteConversationDataset($formattedName); - $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 deleted file mode 100644 index 23594786b5bc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php +++ /dev/null @@ -1,72 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var ConversationDataset $response */ - $response = $conversationDatasetsClient->getConversationDataset($formattedName); - 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 deleted file mode 100644 index 7ae630003275..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 34195388d043..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php +++ /dev/null @@ -1,99 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $inputConfig = new InputConfig(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationDatasetsClient->importConversationData($formattedName, $inputConfig); - $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 deleted file mode 100644 index 94496edfd14a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationDatasetsClient->listConversationDatasets($formattedParent); - - /** @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 deleted file mode 100644 index 8eed2dab7c09..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index d860bc74438f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php +++ /dev/null @@ -1,109 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $inputDataset = (new InputDataset()) - ->setDataset($formattedConversationModelDatasetsDataset); - $conversationModelDatasets = [$inputDataset,]; - $conversationModel = (new ConversationModel()) - ->setDisplayName($conversationModelDisplayName) - ->setDatasets($conversationModelDatasets); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->createConversationModel($conversationModel); - $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 deleted file mode 100644 index 01fa5edadfaf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php +++ /dev/null @@ -1,90 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $conversationModelEvaluation = new ConversationModelEvaluation(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->createConversationModelEvaluation( - $formattedParent, - $conversationModelEvaluation - ); - $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 deleted file mode 100644 index e7bf8d38290c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php +++ /dev/null @@ -1,84 +0,0 @@ -/conversationModels/` - */ -function delete_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->deleteConversationModel($name); - $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 deleted file mode 100644 index 953c43c9be97..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php +++ /dev/null @@ -1,87 +0,0 @@ -/conversationModels/` - */ -function deploy_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->deployConversationModel($name); - $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 deleted file mode 100644 index 7e452efa6591..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php +++ /dev/null @@ -1,66 +0,0 @@ -/conversationModels/` - */ -function get_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var ConversationModel $response */ - $response = $conversationModelsClient->getConversationModel($name); - 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 deleted file mode 100644 index 76b76eb683e4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php +++ /dev/null @@ -1,67 +0,0 @@ -/conversationModels//evaluations/` - */ -function get_conversation_model_evaluation_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var ConversationModelEvaluation $response */ - $response = $conversationModelsClient->getConversationModelEvaluation($name); - 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 deleted file mode 100644 index c1cbdff88eef..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 7339240d4d43..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php +++ /dev/null @@ -1,71 +0,0 @@ -/conversationModels/` - */ -function list_conversation_model_evaluations_sample(string $parent): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationModelsClient->listConversationModelEvaluations($parent); - - /** @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 deleted file mode 100644 index 06886c759433..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php +++ /dev/null @@ -1,71 +0,0 @@ -` - */ -function list_conversation_models_sample(string $parent): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationModelsClient->listConversationModels($parent); - - /** @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 deleted file mode 100644 index 6366d82ab9d6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 46282f73ea7f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php +++ /dev/null @@ -1,87 +0,0 @@ -/conversationModels/` - */ -function undeploy_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->undeployConversationModel($name); - $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 deleted file mode 100644 index f1acaafdca1b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php +++ /dev/null @@ -1,107 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationProfilesClient->clearSuggestionFeatureConfig( - $conversationProfile, - $participantRole, - $suggestionFeatureType - ); - $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 deleted file mode 100644 index 35bf9f51a8d9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php +++ /dev/null @@ -1,83 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $conversationProfile = (new ConversationProfile()) - ->setDisplayName($conversationProfileDisplayName); - - // Call the API and handle any network failures. - try { - /** @var ConversationProfile $response */ - $response = $conversationProfilesClient->createConversationProfile( - $formattedParent, - $conversationProfile - ); - 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 deleted file mode 100644 index 43eaedb46d5b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php +++ /dev/null @@ -1,69 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $conversationProfilesClient->deleteConversationProfile($formattedName); - 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 deleted file mode 100644 index 9b041dbbd200..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php +++ /dev/null @@ -1,71 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var ConversationProfile $response */ - $response = $conversationProfilesClient->getConversationProfile($formattedName); - 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 deleted file mode 100644 index 8a45817c9f46..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 8ca68b838171..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php +++ /dev/null @@ -1,72 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationProfilesClient->listConversationProfiles($formattedParent); - - /** @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 deleted file mode 100644 index 148aeddbe4fa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index d0d3c9d38e9e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php +++ /dev/null @@ -1,110 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $suggestionFeatureConfig = new SuggestionFeatureConfig(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationProfilesClient->setSuggestionFeatureConfig( - $conversationProfile, - $participantRole, - $suggestionFeatureConfig - ); - $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 deleted file mode 100644 index b26048c43bfb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php +++ /dev/null @@ -1,79 +0,0 @@ -setDisplayName($conversationProfileDisplayName); - $updateMask = new FieldMask(); - - // Call the API and handle any network failures. - try { - /** @var ConversationProfile $response */ - $response = $conversationProfilesClient->updateConversationProfile( - $conversationProfile, - $updateMask - ); - 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 deleted file mode 100644 index 21bae124175b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php +++ /dev/null @@ -1,69 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationsClient->completeConversation($formattedName); - 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 deleted file mode 100644 index 0058b3844d75..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php +++ /dev/null @@ -1,102 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $conversation = (new Conversation()) - ->setConversationProfile($formattedConversationConversationProfile); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationsClient->createConversation($formattedParent, $conversation); - 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_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php deleted file mode 100644 index 09f80e224e5c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php +++ /dev/null @@ -1,98 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $message = (new Message()) - ->setContent($statelessConversationMessagesContent); - $statelessConversationMessages = [$message,]; - $statelessConversation = (new MinimalConversation()) - ->setMessages($statelessConversationMessages) - ->setParent($formattedStatelessConversationParent); - $conversationProfile = (new ConversationProfile()) - ->setDisplayName($conversationProfileDisplayName); - - // Call the API and handle any network failures. - try { - /** @var GenerateStatelessSummaryResponse $response */ - $response = $conversationsClient->generateStatelessSummary( - $statelessConversation, - $conversationProfile - ); - 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/get_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php deleted file mode 100644 index b2b22f9c1260..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php +++ /dev/null @@ -1,68 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationsClient->getConversation($formattedName); - 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 deleted file mode 100644 index da5654088478..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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/list_conversations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php deleted file mode 100644 index 1a0a89e1d2f6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php +++ /dev/null @@ -1,72 +0,0 @@ -/locations/`. Please see - * {@see ConversationsClient::projectName()} for help formatting this field. - */ -function list_conversations_sample(string $formattedParent): void -{ - // Create a client. - $conversationsClient = new ConversationsClient(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationsClient->listConversations($formattedParent); - - /** @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 deleted file mode 100644 index 05a399ae5d23..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 844f41f4bf32..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php +++ /dev/null @@ -1,77 +0,0 @@ - - * [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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationsClient->listMessages($formattedParent); - - /** @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/suggest_conversation_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php deleted file mode 100644 index 5caae9706ccc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php +++ /dev/null @@ -1,70 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var SuggestConversationSummaryResponse $response */ - $response = $conversationsClient->suggestConversationSummary($formattedConversation); - 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 deleted file mode 100644 index 87db832c0b28..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php +++ /dev/null @@ -1,112 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $documentKnowledgeTypes = [$documentKnowledgeTypesElement,]; - $document = (new Document()) - ->setDisplayName($documentDisplayName) - ->setMimeType($documentMimeType) - ->setKnowledgeTypes($documentKnowledgeTypes); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->createDocument($formattedParent, $document); - $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 deleted file mode 100644 index c9ea62d3ec8e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php +++ /dev/null @@ -1,86 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->deleteDocument($formattedName); - $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 deleted file mode 100644 index b13f17f549c2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php +++ /dev/null @@ -1,89 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->exportDocument($formattedName); - $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 deleted file mode 100644 index b121f8bf3e81..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php +++ /dev/null @@ -1,68 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $documentsClient->getDocument($formattedName); - 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 deleted file mode 100644 index 88fc99f2603a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 70de52c51255..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php +++ /dev/null @@ -1,110 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $documentTemplateKnowledgeTypes = [$documentTemplateKnowledgeTypesElement,]; - $documentTemplate = (new ImportDocumentTemplate()) - ->setMimeType($documentTemplateMimeType) - ->setKnowledgeTypes($documentTemplateKnowledgeTypes); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->importDocuments($formattedParent, $documentTemplate); - $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 deleted file mode 100644 index 17f89159977c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentsClient->listDocuments($formattedParent); - - /** @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 deleted file mode 100644 index 880cffa907ee..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index e99ac519bddc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php +++ /dev/null @@ -1,94 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->reloadDocument($formattedName); - $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 deleted file mode 100644 index 931a71194e3f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php +++ /dev/null @@ -1,101 +0,0 @@ -setDisplayName($documentDisplayName) - ->setMimeType($documentMimeType) - ->setKnowledgeTypes($documentKnowledgeTypes); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->updateDocument($document); - $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/EntityTypesClient/batch_create_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php deleted file mode 100644 index 09b5645c2a02..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php +++ /dev/null @@ -1,121 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $entitiesSynonyms = [$entitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($entitiesValue) - ->setSynonyms($entitiesSynonyms); - $entities = [$entity,]; - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchCreateEntities($formattedParent, $entities); - $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 deleted file mode 100644 index cf7d4a263026..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php +++ /dev/null @@ -1,96 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $entityValues = [$entityValuesElement,]; - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchDeleteEntities($formattedParent, $entityValues); - $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 deleted file mode 100644 index 6e8a38460aa6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php +++ /dev/null @@ -1,97 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $entityTypeNames = [$entityTypeNamesElement,]; - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); - $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 deleted file mode 100644 index 4322ae722973..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php +++ /dev/null @@ -1,124 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $entitiesSynonyms = [$entitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($entitiesValue) - ->setSynonyms($entitiesSynonyms); - $entities = [$entity,]; - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchUpdateEntities($formattedParent, $entities); - $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 deleted file mode 100644 index 232403a7967d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php +++ /dev/null @@ -1,92 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchUpdateEntityTypes($formattedParent); - $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 deleted file mode 100644 index dc4cce6aa718..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php +++ /dev/null @@ -1,84 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $entityType = (new EntityType()) - ->setDisplayName($entityTypeDisplayName) - ->setKind($entityTypeKind); - - // Call the API and handle any network failures. - try { - /** @var EntityType $response */ - $response = $entityTypesClient->createEntityType($formattedParent, $entityType); - 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 deleted file mode 100644 index 5748edf82816..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php +++ /dev/null @@ -1,69 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $entityTypesClient->deleteEntityType($formattedName); - 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 deleted file mode 100644 index b685238b0d6d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php +++ /dev/null @@ -1,67 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var EntityType $response */ - $response = $entityTypesClient->getEntityType($formattedName); - 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 deleted file mode 100644 index 51363603853e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index f15ab41a2438..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php +++ /dev/null @@ -1,72 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $entityTypesClient->listEntityTypes($formattedParent); - - /** @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 deleted file mode 100644 index bf04677e2266..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 6a8325f6f610..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php +++ /dev/null @@ -1,77 +0,0 @@ -setDisplayName($entityTypeDisplayName) - ->setKind($entityTypeKind); - - // Call the API and handle any network failures. - try { - /** @var EntityType $response */ - $response = $entityTypesClient->updateEntityType($entityType); - 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 deleted file mode 100644 index 380c9a53b612..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php +++ /dev/null @@ -1,75 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $environment = new Environment(); - - // Call the API and handle any network failures. - try { - /** @var Environment $response */ - $response = $environmentsClient->createEnvironment($formattedParent, $environment, $environmentId); - 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 deleted file mode 100644 index d45813d8fbc0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php +++ /dev/null @@ -1,71 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $environmentsClient->deleteEnvironment($formattedName); - 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 deleted file mode 100644 index 3c4e7c3168fa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Environment $response */ - $response = $environmentsClient->getEnvironment($formattedName); - 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 deleted file mode 100644 index c45844906edc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php +++ /dev/null @@ -1,78 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $environmentsClient->getEnvironmentHistory($formattedParent); - - /** @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 deleted file mode 100644 index 27b2a0f62e63..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 100b48c84eb0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php +++ /dev/null @@ -1,75 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $environmentsClient->listEnvironments($formattedParent); - - /** @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 deleted file mode 100644 index 07d7be30e536..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index af5123c261bb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php +++ /dev/null @@ -1,69 +0,0 @@ -updateEnvironment($environment, $updateMask); - 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 deleted file mode 100644 index c9c592e7244a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php +++ /dev/null @@ -1,67 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Fulfillment $response */ - $response = $fulfillmentsClient->getFulfillment($formattedName); - 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 deleted file mode 100644 index c146dfd4f52c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 808b1eff5ec9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index c5d24f04f450..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php +++ /dev/null @@ -1,77 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $fulfillment = (new Fulfillment()) - ->setName($fulfillmentName); - $updateMask = new FieldMask(); - - // Call the API and handle any network failures. - try { - /** @var Fulfillment $response */ - $response = $fulfillmentsClient->updateFulfillment($fulfillment, $updateMask); - 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/IntentsClient/batch_delete_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php deleted file mode 100644 index 0709129cd8d1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php +++ /dev/null @@ -1,97 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $intent = (new Intent()) - ->setDisplayName($intentsDisplayName); - $intents = [$intent,]; - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $intentsClient->batchDeleteIntents($formattedParent, $intents); - $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 deleted file mode 100644 index a9faa4b5d3a4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php +++ /dev/null @@ -1,92 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $intentsClient->batchUpdateIntents($formattedParent); - $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 deleted file mode 100644 index 2307c22737e6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php +++ /dev/null @@ -1,77 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $intent = (new Intent()) - ->setDisplayName($intentDisplayName); - - // Call the API and handle any network failures. - try { - /** @var Intent $response */ - $response = $intentsClient->createIntent($formattedParent, $intent); - 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 deleted file mode 100644 index 4a3d19ec1f44..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php +++ /dev/null @@ -1,70 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $intentsClient->deleteIntent($formattedName); - 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 deleted file mode 100644 index e6e2fad64fc0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php +++ /dev/null @@ -1,67 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Intent $response */ - $response = $intentsClient->getIntent($formattedName); - 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 deleted file mode 100644 index 177e67b62277..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 770f91e1140f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php +++ /dev/null @@ -1,80 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $intentsClient->listIntents($formattedParent); - - /** @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 deleted file mode 100644 index 30cb797e8312..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 0b54b3704900..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php +++ /dev/null @@ -1,73 +0,0 @@ -setDisplayName($intentDisplayName); - - // Call the API and handle any network failures. - try { - /** @var Intent $response */ - $response = $intentsClient->updateIntent($intent); - 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 deleted file mode 100644 index f6bbbd05697b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php +++ /dev/null @@ -1,76 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $knowledgeBase = (new KnowledgeBase()) - ->setDisplayName($knowledgeBaseDisplayName); - - // Call the API and handle any network failures. - try { - /** @var KnowledgeBase $response */ - $response = $knowledgeBasesClient->createKnowledgeBase($formattedParent, $knowledgeBase); - 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 deleted file mode 100644 index 903609bbdc00..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php +++ /dev/null @@ -1,66 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $knowledgeBasesClient->deleteKnowledgeBase($formattedName); - 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 deleted file mode 100644 index bda173eafa0a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php +++ /dev/null @@ -1,68 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var KnowledgeBase $response */ - $response = $knowledgeBasesClient->getKnowledgeBase($formattedName); - 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 deleted file mode 100644 index 8362d31264fc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index de802bdfe9c4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php +++ /dev/null @@ -1,72 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $knowledgeBasesClient->listKnowledgeBases($formattedParent); - - /** @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 deleted file mode 100644 index c20bb9d82c39..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index de83978a7890..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php +++ /dev/null @@ -1,70 +0,0 @@ -setDisplayName($knowledgeBaseDisplayName); - - // Call the API and handle any network failures. - try { - /** @var KnowledgeBase $response */ - $response = $knowledgeBasesClient->updateKnowledgeBase($knowledgeBase); - 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 deleted file mode 100644 index ea2a07165aaa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php +++ /dev/null @@ -1,77 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var AnalyzeContentResponse $response */ - $response = $participantsClient->analyzeContent($formattedParticipant); - 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 deleted file mode 100644 index ac93afe4f345..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php +++ /dev/null @@ -1,71 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $participant = new Participant(); - - // Call the API and handle any network failures. - try { - /** @var Participant $response */ - $response = $participantsClient->createParticipant($formattedParent, $participant); - 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 deleted file mode 100644 index a4717b996ff4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index ed68078dfcf9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php +++ /dev/null @@ -1,72 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Participant $response */ - $response = $participantsClient->getParticipant($formattedName); - 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 deleted file mode 100644 index 440555880149..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 8359a672d1f7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $participantsClient->listParticipants($formattedParent); - - /** @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 deleted file mode 100644 index ca78aadb5c28..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php +++ /dev/null @@ -1,97 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $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 deleted file mode 100644 index 5abba2ea21fb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var SuggestArticlesResponse $response */ - $response = $participantsClient->suggestArticles($formattedParent); - 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 deleted file mode 100644 index 305452d83d07..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var SuggestFaqAnswersResponse $response */ - $response = $participantsClient->suggestFaqAnswers($formattedParent); - 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_smart_replies.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php deleted file mode 100644 index adc3807aeaf4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php +++ /dev/null @@ -1,73 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var SuggestSmartRepliesResponse $response */ - $response = $participantsClient->suggestSmartReplies($formattedParent); - 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 deleted file mode 100644 index 97b1187d7947..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php +++ /dev/null @@ -1,58 +0,0 @@ -updateParticipant($participant, $updateMask); - 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 deleted file mode 100644 index b5513f20f7c3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php +++ /dev/null @@ -1,140 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($sessionEntityTypeEntitiesValue) - ->setSynonyms($sessionEntityTypeEntitiesSynonyms); - $sessionEntityTypeEntities = [$entity,]; - $sessionEntityType = (new SessionEntityType()) - ->setName($sessionEntityTypeName) - ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) - ->setEntities($sessionEntityTypeEntities); - - // Call the API and handle any network failures. - try { - /** @var SessionEntityType $response */ - $response = $sessionEntityTypesClient->createSessionEntityType( - $formattedParent, - $sessionEntityType - ); - 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 deleted file mode 100644 index b6f56f0de7cf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php +++ /dev/null @@ -1,78 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $sessionEntityTypesClient->deleteSessionEntityType($formattedName); - 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 deleted file mode 100644 index 5590902a38e5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index c4ff566fb7fc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php +++ /dev/null @@ -1,80 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var SessionEntityType $response */ - $response = $sessionEntityTypesClient->getSessionEntityType($formattedName); - 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 deleted file mode 100644 index 5673a2ad0429..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 57f99fff2eaf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php +++ /dev/null @@ -1,80 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent); - - /** @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 deleted file mode 100644 index 931ba432a559..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php +++ /dev/null @@ -1,124 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($sessionEntityTypeEntitiesValue) - ->setSynonyms($sessionEntityTypeEntitiesSynonyms); - $sessionEntityTypeEntities = [$entity,]; - $sessionEntityType = (new SessionEntityType()) - ->setName($sessionEntityTypeName) - ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) - ->setEntities($sessionEntityTypeEntities); - - // Call the API and handle any network failures. - try { - /** @var SessionEntityType $response */ - $response = $sessionEntityTypesClient->updateSessionEntityType($sessionEntityType); - 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 deleted file mode 100644 index 569dcb6ebdb2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php +++ /dev/null @@ -1,100 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $queryInput = new QueryInput(); - - // Call the API and handle any network failures. - try { - /** @var DetectIntentResponse $response */ - $response = $sessionsClient->detectIntent($formattedSession, $queryInput); - 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 deleted file mode 100644 index f12b6d2c5964..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 972718b7fa62..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index 9c7a2254b249..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php +++ /dev/null @@ -1,109 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $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/VersionsClient/create_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php deleted file mode 100644 index e089e250e1ed..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php +++ /dev/null @@ -1,75 +0,0 @@ -/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 any non-scalar elements to be passed along with the request. - $version = new Version(); - - // Call the API and handle any network failures. - try { - /** @var Version $response */ - $response = $versionsClient->createVersion($formattedParent, $version); - 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 deleted file mode 100644 index 0210b6fa6bf1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php +++ /dev/null @@ -1,69 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - $versionsClient->deleteVersion($formattedName); - 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 deleted file mode 100644 index 2a4e47d09c7c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - 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 deleted file mode 100644 index 9a5a28ce621d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php +++ /dev/null @@ -1,71 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var Version $response */ - $response = $versionsClient->getVersion($formattedName); - 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 deleted file mode 100644 index 9041a7fb8603..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @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 deleted file mode 100644 index d093ad705a0f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php +++ /dev/null @@ -1,75 +0,0 @@ -/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(); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $versionsClient->listVersions($formattedParent); - - /** @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 deleted file mode 100644 index 1d7662bb6779..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php +++ /dev/null @@ -1,62 +0,0 @@ -updateVersion($version, $updateMask); - 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/AgentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php deleted file mode 100644 index f35575682398..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php +++ /dev/null @@ -1,34 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::deleteAgentAsync()} . - * - * @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 self::exportAgentAsync()} . - * - * @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 self::getAgentAsync()} . - * - * @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 self::getValidationResultAsync()} . - * - * @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 self::importAgentAsync()} . - * - * @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 self::restoreAgentAsync()} . - * - * @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 self::searchAgentsAsync()} . - * - * @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 self::setAgentAsync()} . - * - * @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 self::trainAgentAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/AnswerRecordsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AnswerRecordsBaseClient.php deleted file mode 100644 index 0acca13dc47c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/AnswerRecordsBaseClient.php +++ /dev/null @@ -1,390 +0,0 @@ - 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 - * 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 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_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_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, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - answerRecord: projects/{project}/answerRecords/{answer_record} - * - location: projects/{project}/locations/{location} - * - project: projects/{project} - * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} - * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} - * - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::listAnswerRecordsAsync()} . - * - * @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 self::updateAnswerRecordAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/ContextsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ContextsBaseClient.php deleted file mode 100644 index 5e0517939266..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ContextsBaseClient.php +++ /dev/null @@ -1,614 +0,0 @@ - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createContextAsync()} . - * - * @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 self::deleteAllContextsAsync()} . - * - * @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 self::deleteContextAsync()} . - * - * @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 self::getContextAsync()} . - * - * @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 self::listContextsAsync()} . - * - * @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 self::updateContextAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/ConversationDatasetsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationDatasetsBaseClient.php deleted file mode 100644 index 000c7bae45c6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationDatasetsBaseClient.php +++ /dev/null @@ -1,487 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createConversationDatasetAsync()} . - * - * @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 self::deleteConversationDatasetAsync()} . - * - * @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 self::getConversationDatasetAsync()} . - * - * @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 self::importConversationDataAsync()} . - * - * @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 self::listConversationDatasetsAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/ConversationModelsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationModelsBaseClient.php deleted file mode 100644 index 9b5bcc80f5a9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationModelsBaseClient.php +++ /dev/null @@ -1,765 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createConversationModelAsync()} . - * - * @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 self::createConversationModelEvaluationAsync()} . - * - * @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 self::deleteConversationModelAsync()} . - * - * @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 self::deployConversationModelAsync()} . - * - * @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 self::getConversationModelAsync()} . - * - * @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 self::getConversationModelEvaluationAsync()} . - * - * @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 self::listConversationModelEvaluationsAsync()} . - * - * @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 self::listConversationModelsAsync()} . - * - * @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 self::undeployConversationModelAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/ConversationProfilesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationProfilesBaseClient.php deleted file mode 100644 index f6bfdf228752..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationProfilesBaseClient.php +++ /dev/null @@ -1,838 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 - * 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_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} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::clearSuggestionFeatureConfigAsync()} . - * - * @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.CreateTime][] and [ConversationProfile.UpdateTime][] - * aren't populated in the response. You can retrieve them via - * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] - * API. - * - * The async variant is {@see self::createConversationProfileAsync()} . - * - * @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 self::deleteConversationProfileAsync()} . - * - * @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 self::getConversationProfileAsync()} . - * - * @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 self::listConversationProfilesAsync()} . - * - * @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 self::setSuggestionFeatureConfigAsync()} . - * - * @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.CreateTime][] and [ConversationProfile.UpdateTime][] - * aren't populated in the response. You can retrieve them via - * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] - * API. - * - * The async variant is {@see self::updateConversationProfileAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/ConversationsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationsBaseClient.php deleted file mode 100644 index ee5d9a16a590..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ConversationsBaseClient.php +++ /dev/null @@ -1,913 +0,0 @@ - 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 - * 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 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 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 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_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_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} - * - conversation: projects/{project}/conversations/{conversation} - * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} - * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} - * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - message: projects/{project}/conversations/{conversation}/messages/{message} - * - 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 - * - 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} - * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::completeConversationAsync()} . - * - * @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 self::createConversationAsync()} . - * - * @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 summary for a conversation that does not have a - * resource created for it. - * - * The async variant is {@see self::generateStatelessSummaryAsync()} . - * - * @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(); - } - - /** - * Retrieves the specific conversation. - * - * The async variant is {@see self::getConversationAsync()} . - * - * @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(); - } - - /** - * Returns the list of all conversations in the specified project. - * - * The async variant is {@see self::listConversationsAsync()} . - * - * @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 self::listMessagesAsync()} . - * - * @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); - } - - /** - * 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 self::suggestConversationSummaryAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/DocumentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/DocumentsBaseClient.php deleted file mode 100644 index d074c8411169..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/DocumentsBaseClient.php +++ /dev/null @@ -1,669 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createDocumentAsync()} . - * - * @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 self::deleteDocumentAsync()} . - * - * @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 self::exportDocumentAsync()} . - * - * @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 self::getDocumentAsync()} . - * - * @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 self::importDocumentsAsync()} . - * - * @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 self::listDocumentsAsync()} . - * - * @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 self::reloadDocumentAsync()} . - * - * @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 self::updateDocumentAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/EntityTypesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EntityTypesBaseClient.php deleted file mode 100644 index 22566ed48345..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EntityTypesBaseClient.php +++ /dev/null @@ -1,727 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::batchCreateEntitiesAsync()} . - * - * @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 self::batchDeleteEntitiesAsync()} . - * - * @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 self::batchDeleteEntityTypesAsync()} . - * - * @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 self::batchUpdateEntitiesAsync()} . - * - * @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 self::batchUpdateEntityTypesAsync()} . - * - * @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 self::createEntityTypeAsync()} . - * - * @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 self::deleteEntityTypeAsync()} . - * - * @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 self::getEntityTypeAsync()} . - * - * @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 self::listEntityTypesAsync()} . - * - * @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 self::updateEntityTypeAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/EnvironmentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EnvironmentsBaseClient.php deleted file mode 100644 index 211aa964a530..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/EnvironmentsBaseClient.php +++ /dev/null @@ -1,623 +0,0 @@ - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createEnvironmentAsync()} . - * - * @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 self::deleteEnvironmentAsync()} . - * - * @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 self::getEnvironmentAsync()} . - * - * @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 self::getEnvironmentHistoryAsync()} . - * - * @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 self::listEnvironmentsAsync()} . - * - * @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 self::updateEnvironmentAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/FulfillmentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/FulfillmentsBaseClient.php deleted file mode 100644 index 40f53daa547c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/FulfillmentsBaseClient.php +++ /dev/null @@ -1,348 +0,0 @@ - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::getFulfillmentAsync()} . - * - * @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 self::updateFulfillmentAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/IntentsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/IntentsBaseClient.php deleted file mode 100644 index dc8b0443d2ae..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/IntentsBaseClient.php +++ /dev/null @@ -1,821 +0,0 @@ - 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::batchDeleteIntentsAsync()} . - * - * @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 self::batchUpdateIntentsAsync()} . - * - * @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 self::createIntentAsync()} . - * - * @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 self::deleteIntentAsync()} . - * - * @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 self::getIntentAsync()} . - * - * @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 self::listIntentsAsync()} . - * - * @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 self::updateIntentAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/KnowledgeBasesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/KnowledgeBasesBaseClient.php deleted file mode 100644 index d6346df2d440..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/KnowledgeBasesBaseClient.php +++ /dev/null @@ -1,465 +0,0 @@ - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createKnowledgeBaseAsync()} . - * - * @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 self::deleteKnowledgeBaseAsync()} . - * - * @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 self::getKnowledgeBaseAsync()} . - * - * @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 self::listKnowledgeBasesAsync()} . - * - * @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 self::updateKnowledgeBaseAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/ParticipantsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ParticipantsBaseClient.php deleted file mode 100644 index 423b944374a1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/ParticipantsBaseClient.php +++ /dev/null @@ -1,1006 +0,0 @@ - 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 - * 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} - * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::analyzeContentAsync()} . - * - * @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 self::createParticipantAsync()} . - * - * @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 self::getParticipantAsync()} . - * - * @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 self::listParticipantsAsync()} . - * - * @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). - * - * @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 self::suggestArticlesAsync()} . - * - * @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 self::suggestFaqAnswersAsync()} . - * - * @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 smart replies for a participant based on specific historical - * messages. - * - * The async variant is {@see self::suggestSmartRepliesAsync()} . - * - * @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 self::updateParticipantAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/SessionEntityTypesBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionEntityTypesBaseClient.php deleted file mode 100644 index 00bb3b2bf189..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionEntityTypesBaseClient.php +++ /dev/null @@ -1,613 +0,0 @@ - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createSessionEntityTypeAsync()} . - * - * @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 self::deleteSessionEntityTypeAsync()} . - * - * @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 self::getSessionEntityTypeAsync()} . - * - * @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 self::listSessionEntityTypesAsync()} . - * - * @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 self::updateSessionEntityTypeAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/SessionsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionsBaseClient.php deleted file mode 100644 index 22c6a7be9bf2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/SessionsBaseClient.php +++ /dev/null @@ -1,648 +0,0 @@ - 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 - * 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} - * - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::detectIntentAsync()} . - * - * @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). - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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/BaseClient/VersionsBaseClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/VersionsBaseClient.php deleted file mode 100644 index 53f5fac6362b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/BaseClient/VersionsBaseClient.php +++ /dev/null @@ -1,486 +0,0 @@ - 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 $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $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 self::createVersionAsync()} . - * - * @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 self::deleteVersionAsync()} . - * - * @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 self::getVersionAsync()} . - * - * @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 self::listVersionsAsync()} . - * - * @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 self::updateVersionAsync()} . - * - * @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 self::getLocationAsync()} . - * - * @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. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @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 deleted file mode 100644 index 60ef14d747b8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php +++ /dev/null @@ -1,40 +0,0 @@ -projectName('[PROJECT]'); - * $agentsClient->deleteAgent($formattedParent); - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\AgentsClient} to use the new surface. - */ -class AgentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Agents'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project, $location) - { - return self::getLocationNameTemplate()->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($project) - { - return self::getProjectNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Deletes the specified agent. - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $agentsClient->deleteAgent($formattedParent); - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent to delete is associated with. - * Format: `projects/`. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteAgent($parent, array $optionalArgs = []) - { - $request = new DeleteAgentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteAgent', GPBEmpty::class, $optionalArgs, $request)->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] - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $agentUri = 'agent_uri'; - * $operationResponse = $agentsClient->exportAgent($formattedParent, $agentUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $agentsClient->exportAgent($formattedParent, $agentUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'exportAgent'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent to export is associated with. - * Format: `projects/`. - * @param string $agentUri 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). - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportAgent($parent, $agentUri, array $optionalArgs = []) - { - $request = new ExportAgentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAgentUri($agentUri); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportAgent', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Retrieves the specified agent. - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $response = $agentsClient->getAgent($formattedParent); - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent to fetch is associated with. - * Format: `projects/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Agent - * - * @throws ApiException if the remote call fails - */ - public function getAgent($parent, array $optionalArgs = []) - { - $request = new GetAgentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetAgent', Agent::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets agent validation result. Agent validation is performed during - * training time and is updated automatically when training is completed. - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $response = $agentsClient->getValidationResult($formattedParent); - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent is associated with. - * Format: `projects/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $languageCode - * 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. - * @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 \Google\Cloud\Dialogflow\V2\ValidationResult - * - * @throws ApiException if the remote call fails - */ - public function getValidationResult($parent, array $optionalArgs = []) - { - $request = new GetValidationResultRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetValidationResult', ValidationResult::class, $optionalArgs, $request)->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). - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $operationResponse = $agentsClient->importAgent($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $agentsClient->importAgent($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'importAgent'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent to import is associated with. - * Format: `projects/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $agentUri - * 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 $agentContent - * Zip compressed raw byte content for agent. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importAgent($parent, array $optionalArgs = []) - { - $request = new ImportAgentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['agentUri'])) { - $request->setAgentUri($optionalArgs['agentUri']); - } - - if (isset($optionalArgs['agentContent'])) { - $request->setAgentContent($optionalArgs['agentContent']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportAgent', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $operationResponse = $agentsClient->restoreAgent($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $agentsClient->restoreAgent($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'restoreAgent'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent to restore is associated with. - * Format: `projects/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $agentUri - * 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 $agentContent - * Zip compressed raw byte content for agent. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restoreAgent($parent, array $optionalArgs = []) - { - $request = new RestoreAgentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['agentUri'])) { - $request->setAgentUri($optionalArgs['agentUri']); - } - - if (isset($optionalArgs['agentContent'])) { - $request->setAgentContent($optionalArgs['agentContent']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreAgent', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $agentsClient->searchAgents($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $agentsClient->searchAgents($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to list agents from. - * Format: `projects/`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchAgents($parent, array $optionalArgs = []) - { - $request = new SearchAgentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('SearchAgents', $optionalArgs, SearchAgentsResponse::class, $request); - } - - /** - * 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). - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $agent = new Agent(); - * $response = $agentsClient->setAgent($agent); - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param Agent $agent Required. The agent to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @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 \Google\Cloud\Dialogflow\V2\Agent - * - * @throws ApiException if the remote call fails - */ - public function setAgent($agent, array $optionalArgs = []) - { - $request = new SetAgentRequest(); - $requestParamHeaders = []; - $request->setAgent($agent); - $requestParamHeaders['agent.parent'] = $agent->getParent(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetAgent', Agent::class, $optionalArgs, $request)->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). - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $formattedParent = $agentsClient->projectName('[PROJECT]'); - * $operationResponse = $agentsClient->trainAgent($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $agentsClient->trainAgent($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $agentsClient->resumeOperation($operationName, 'trainAgent'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project that the agent to train is associated with. - * Format: `projects/`. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function trainAgent($parent, array $optionalArgs = []) - { - $request = new TrainAgentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('TrainAgent', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * $response = $agentsClient->getLocation(); - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $agentsClient = new AgentsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $agentsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $agentsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $agentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php deleted file mode 100644 index ba926ddd83fb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php +++ /dev/null @@ -1,629 +0,0 @@ -projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $answerRecordsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\AnswerRecordsClient} to use the new surface. - */ -class AnswerRecordsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.AnswerRecords'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $answerRecordNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $projectAnswerRecordNameTemplate; - - private static $projectLocationAnswerRecordNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAnswerRecordNameTemplate() - { - if (self::$answerRecordNameTemplate == null) { - self::$answerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); - } - - return self::$answerRecordNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectAnswerRecordNameTemplate() - { - if (self::$projectAnswerRecordNameTemplate == null) { - self::$projectAnswerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); - } - - return self::$projectAnswerRecordNameTemplate; - } - - private static function getProjectLocationAnswerRecordNameTemplate() - { - if (self::$projectLocationAnswerRecordNameTemplate == null) { - self::$projectLocationAnswerRecordNameTemplate = new PathTemplate('projects/{project}/locations/{location}/answerRecords/{answer_record}'); - } - - return self::$projectLocationAnswerRecordNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'answerRecord' => self::getAnswerRecordNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAnswerRecord' => self::getProjectAnswerRecordNameTemplate(), - 'projectLocationAnswerRecord' => self::getProjectLocationAnswerRecordNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $answerRecord) - { - return self::getAnswerRecordNameTemplate()->render([ - 'project' => $project, - 'answer_record' => $answerRecord, - ]); - } - - /** - * 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($project, $location) - { - return self::getLocationNameTemplate()->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($project) - { - return self::getProjectNameTemplate()->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($project, $answerRecord) - { - return self::getProjectAnswerRecordNameTemplate()->render([ - 'project' => $project, - 'answer_record' => $answerRecord, - ]); - } - - /** - * 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($project, $location, $answerRecord) - { - return self::getProjectLocationAnswerRecordNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'answer_record' => $answerRecord, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - answerRecord: projects/{project}/answerRecords/{answer_record} - * - location: projects/{project}/locations/{location} - * - project: projects/{project} - * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} - * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} - * - * 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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Returns the list of all answer records in the specified project in reverse - * chronological order. - * - * Sample code: - * ``` - * $answerRecordsClient = new AnswerRecordsClient(); - * try { - * $formattedParent = $answerRecordsClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $answerRecordsClient->listAnswerRecords($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $answerRecordsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to list all answer records for in reverse - * chronological order. Format: `projects//locations/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. Filters to restrict results to specific answer records. - * - * Marked deprecated as it hasn't been, and isn't currently, supported. - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAnswerRecords($parent, array $optionalArgs = []) - { - $request = new ListAnswerRecordsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListAnswerRecords', $optionalArgs, ListAnswerRecordsResponse::class, $request); - } - - /** - * Updates the specified answer record. - * - * Sample code: - * ``` - * $answerRecordsClient = new AnswerRecordsClient(); - * try { - * $answerRecord = new AnswerRecord(); - * $updateMask = new FieldMask(); - * $response = $answerRecordsClient->updateAnswerRecord($answerRecord, $updateMask); - * } finally { - * $answerRecordsClient->close(); - * } - * ``` - * - * @param AnswerRecord $answerRecord Required. Answer record to update. - * @param FieldMask $updateMask Required. The mask to control which fields get updated. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\AnswerRecord - * - * @throws ApiException if the remote call fails - */ - public function updateAnswerRecord($answerRecord, $updateMask, array $optionalArgs = []) - { - $request = new UpdateAnswerRecordRequest(); - $requestParamHeaders = []; - $request->setAnswerRecord($answerRecord); - $request->setUpdateMask($updateMask); - $requestParamHeaders['answer_record.name'] = $answerRecord->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateAnswerRecord', AnswerRecord::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $answerRecordsClient = new AnswerRecordsClient(); - * try { - * $response = $answerRecordsClient->getLocation(); - * } finally { - * $answerRecordsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $answerRecordsClient = new AnswerRecordsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $answerRecordsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $answerRecordsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $answerRecordsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php deleted file mode 100644 index 91bc011bb2f1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php +++ /dev/null @@ -1,977 +0,0 @@ -sessionName('[PROJECT]', '[SESSION]'); - * $context = new Context(); - * $response = $contextsClient->createContext($formattedParent, $context); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\ContextsClient} to use the new surface. - */ -class ContextsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Contexts'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $contextNameTemplate; - - private static $projectEnvironmentUserSessionNameTemplate; - - private static $projectEnvironmentUserSessionContextNameTemplate; - - private static $projectLocationEnvironmentUserSessionNameTemplate; - - private static $projectLocationEnvironmentUserSessionContextNameTemplate; - - private static $projectLocationSessionNameTemplate; - - private static $projectLocationSessionContextNameTemplate; - - private static $projectSessionNameTemplate; - - private static $projectSessionContextNameTemplate; - - private static $sessionNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$contextNameTemplate; - } - - private static function getProjectEnvironmentUserSessionNameTemplate() - { - if (self::$projectEnvironmentUserSessionNameTemplate == null) { - self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectEnvironmentUserSessionNameTemplate; - } - - private static function getProjectEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { - self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectLocationEnvironmentUserSessionNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectLocationSessionNameTemplate() - { - if (self::$projectLocationSessionNameTemplate == null) { - self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); - } - - return self::$projectLocationSessionNameTemplate; - } - - private static function getProjectLocationSessionContextNameTemplate() - { - if (self::$projectLocationSessionContextNameTemplate == null) { - self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationSessionContextNameTemplate; - } - - private static function getProjectSessionNameTemplate() - { - if (self::$projectSessionNameTemplate == null) { - self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$projectSessionNameTemplate; - } - - private static function getProjectSessionContextNameTemplate() - { - if (self::$projectSessionContextNameTemplate == null) { - self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectSessionContextNameTemplate; - } - - private static function getSessionNameTemplate() - { - if (self::$sessionNameTemplate == null) { - self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$sessionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'context' => self::getContextNameTemplate(), - 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), - 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), - 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), - 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), - 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), - 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), - 'projectSession' => self::getProjectSessionNameTemplate(), - 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), - 'session' => self::getSessionNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $session, $context) - { - return self::getContextNameTemplate()->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($project, $environment, $user, $session) - { - return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) - { - return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $location, $environment, $user, $session) - { - return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) - { - return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $session) - { - return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) - { - return self::getProjectLocationSessionContextNameTemplate()->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($project, $session) - { - return self::getProjectSessionNameTemplate()->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($project, $session, $context) - { - return self::getProjectSessionContextNameTemplate()->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($project, $session) - { - return self::getSessionNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a context. - * - * If the specified context already exists, overrides the context. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $formattedParent = $contextsClient->sessionName('[PROJECT]', '[SESSION]'); - * $context = new Context(); - * $response = $contextsClient->createContext($formattedParent, $context); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @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. - * @param Context $context Required. The context to create. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Context - * - * @throws ApiException if the remote call fails - */ - public function createContext($parent, $context, array $optionalArgs = []) - { - $request = new CreateContextRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setContext($context); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateContext', Context::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes all active contexts in the specified session. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $formattedParent = $contextsClient->sessionName('[PROJECT]', '[SESSION]'); - * $contextsClient->deleteAllContexts($formattedParent); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteAllContexts($parent, array $optionalArgs = []) - { - $request = new DeleteAllContextsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteAllContexts', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the specified context. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $formattedName = $contextsClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); - * $contextsClient->deleteContext($formattedName); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteContext($name, array $optionalArgs = []) - { - $request = new DeleteContextRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteContext', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified context. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $formattedName = $contextsClient->contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); - * $response = $contextsClient->getContext($formattedName); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Context - * - * @throws ApiException if the remote call fails - */ - public function getContext($name, array $optionalArgs = []) - { - $request = new GetContextRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetContext', Context::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all contexts in the specified session. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $formattedParent = $contextsClient->sessionName('[PROJECT]', '[SESSION]'); - * // Iterate over pages of elements - * $pagedResponse = $contextsClient->listContexts($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $contextsClient->listContexts($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listContexts($parent, array $optionalArgs = []) - { - $request = new ListContextsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListContexts', $optionalArgs, ListContextsResponse::class, $request); - } - - /** - * Updates the specified context. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $context = new Context(); - * $response = $contextsClient->updateContext($context); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @param Context $context Required. The context to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @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 \Google\Cloud\Dialogflow\V2\Context - * - * @throws ApiException if the remote call fails - */ - public function updateContext($context, array $optionalArgs = []) - { - $request = new UpdateContextRequest(); - $requestParamHeaders = []; - $request->setContext($context); - $requestParamHeaders['context.name'] = $context->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateContext', Context::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * $response = $contextsClient->getLocation(); - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $contextsClient = new ContextsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $contextsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $contextsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $contextsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php deleted file mode 100644 index 98a924542928..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php +++ /dev/null @@ -1,817 +0,0 @@ -createConversationDataset($parent, $conversationDataset); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'createConversationDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\ConversationDatasetsClient} to use the new - * surface. - */ -class ConversationDatasetsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationDatasets'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $conversationDatasetNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getConversationDatasetNameTemplate() - { - if (self::$conversationDatasetNameTemplate == null) { - self::$conversationDatasetNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}'); - } - - return self::$conversationDatasetNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'conversationDataset' => self::getConversationDatasetNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $location, $conversationDataset) - { - return self::getConversationDatasetNameTemplate()->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($project, $location) - { - return self::getLocationNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * 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] - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * $parent = 'parent'; - * $conversationDataset = new ConversationDataset(); - * $operationResponse = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationDatasetsClient->createConversationDataset($parent, $conversationDataset); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'createConversationDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to create conversation dataset for. Format: - * `projects//locations/` - * @param ConversationDataset $conversationDataset Required. The conversation dataset to create. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createConversationDataset($parent, $conversationDataset, array $optionalArgs = []) - { - $request = new CreateConversationDatasetRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConversationDataset($conversationDataset); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateConversationDataset', $optionalArgs, $request, $this->getOperationsClient())->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) - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * $formattedName = $conversationDatasetsClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - * $operationResponse = $conversationDatasetsClient->deleteConversationDataset($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationDatasetsClient->deleteConversationDataset($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'deleteConversationDataset'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation dataset to delete. Format: - * `projects//locations//conversationDatasets/` - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteConversationDataset($name, array $optionalArgs = []) - { - $request = new DeleteConversationDatasetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteConversationDataset', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Retrieves the specified conversation dataset. - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * $formattedName = $conversationDatasetsClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - * $response = $conversationDatasetsClient->getConversationDataset($formattedName); - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation dataset to retrieve. Format: - * `projects//locations//conversationDatasets/` - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\ConversationDataset - * - * @throws ApiException if the remote call fails - */ - public function getConversationDataset($name, array $optionalArgs = []) - { - $request = new GetConversationDatasetRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConversationDataset', ConversationDataset::class, $optionalArgs, $request)->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] - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * $formattedName = $conversationDatasetsClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - * $inputConfig = new InputConfig(); - * $operationResponse = $conversationDatasetsClient->importConversationData($formattedName, $inputConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationDatasetsClient->importConversationData($formattedName, $inputConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationDatasetsClient->resumeOperation($operationName, 'importConversationData'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param string $name Required. Dataset resource name. Format: - * `projects//locations//conversationDatasets/` - * @param InputConfig $inputConfig Required. Configuration describing where to import data from. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importConversationData($name, $inputConfig, array $optionalArgs = []) - { - $request = new ImportConversationDataRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setInputConfig($inputConfig); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportConversationData', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Returns the list of all conversation datasets in the specified - * project and location. - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * $formattedParent = $conversationDatasetsClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $conversationDatasetsClient->listConversationDatasets($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationDatasetsClient->listConversationDatasets($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project and location name to list all conversation datasets - * for. Format: `projects//locations/` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConversationDatasets($parent, array $optionalArgs = []) - { - $request = new ListConversationDatasetsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConversationDatasets', $optionalArgs, ListConversationDatasetsResponse::class, $request); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * $response = $conversationDatasetsClient->getLocation(); - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $conversationDatasetsClient = new ConversationDatasetsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $conversationDatasetsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationDatasetsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationDatasetsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php deleted file mode 100644 index 991b8f7dee23..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php +++ /dev/null @@ -1,1327 +0,0 @@ -createConversationModel($conversationModel); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationModelsClient->createConversationModel($conversationModel); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'createConversationModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\ConversationModelsClient} to use the new - * surface. - */ -class ConversationModelsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationModels'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $conversationDatasetNameTemplate; - - private static $conversationModelNameTemplate; - - private static $conversationModelEvaluationNameTemplate; - - private static $documentNameTemplate; - - private static $projectConversationModelNameTemplate; - - private static $projectConversationModelEvaluationNameTemplate; - - private static $projectKnowledgeBaseDocumentNameTemplate; - - private static $projectLocationConversationModelNameTemplate; - - private static $projectLocationConversationModelEvaluationNameTemplate; - - private static $projectLocationKnowledgeBaseDocumentNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getConversationDatasetNameTemplate() - { - if (self::$conversationDatasetNameTemplate == null) { - self::$conversationDatasetNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}'); - } - - return self::$conversationDatasetNameTemplate; - } - - private static function getConversationModelNameTemplate() - { - if (self::$conversationModelNameTemplate == null) { - self::$conversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); - } - - return self::$conversationModelNameTemplate; - } - - private static function getConversationModelEvaluationNameTemplate() - { - if (self::$conversationModelEvaluationNameTemplate == null) { - self::$conversationModelEvaluationNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}'); - } - - return self::$conversationModelEvaluationNameTemplate; - } - - private static function getDocumentNameTemplate() - { - if (self::$documentNameTemplate == null) { - self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$documentNameTemplate; - } - - private static function getProjectConversationModelNameTemplate() - { - if (self::$projectConversationModelNameTemplate == null) { - self::$projectConversationModelNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}'); - } - - return self::$projectConversationModelNameTemplate; - } - - private static function getProjectConversationModelEvaluationNameTemplate() - { - if (self::$projectConversationModelEvaluationNameTemplate == null) { - self::$projectConversationModelEvaluationNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}'); - } - - return self::$projectConversationModelEvaluationNameTemplate; - } - - private static function getProjectKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { - self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectKnowledgeBaseDocumentNameTemplate; - } - - private static function getProjectLocationConversationModelNameTemplate() - { - if (self::$projectLocationConversationModelNameTemplate == null) { - self::$projectLocationConversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); - } - - return self::$projectLocationConversationModelNameTemplate; - } - - private static function getProjectLocationConversationModelEvaluationNameTemplate() - { - if (self::$projectLocationConversationModelEvaluationNameTemplate == null) { - self::$projectLocationConversationModelEvaluationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}'); - } - - return self::$projectLocationConversationModelEvaluationNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { - self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectLocationKnowledgeBaseDocumentNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'conversationDataset' => self::getConversationDatasetNameTemplate(), - 'conversationModel' => self::getConversationModelNameTemplate(), - 'conversationModelEvaluation' => self::getConversationModelEvaluationNameTemplate(), - 'document' => self::getDocumentNameTemplate(), - 'projectConversationModel' => self::getProjectConversationModelNameTemplate(), - 'projectConversationModelEvaluation' => self::getProjectConversationModelEvaluationNameTemplate(), - 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), - 'projectLocationConversationModel' => self::getProjectLocationConversationModelNameTemplate(), - 'projectLocationConversationModelEvaluation' => self::getProjectLocationConversationModelEvaluationNameTemplate(), - 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $location, $conversationDataset) - { - return self::getConversationDatasetNameTemplate()->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($project, $location, $conversationModel) - { - return self::getConversationModelNameTemplate()->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($project, $conversationModel, $evaluation) - { - return self::getConversationModelEvaluationNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getDocumentNameTemplate()->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($project, $conversationModel) - { - return self::getProjectConversationModelNameTemplate()->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($project, $conversationModel, $evaluation) - { - return self::getProjectConversationModelEvaluationNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location, $conversationModel) - { - return self::getProjectLocationConversationModelNameTemplate()->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($project, $location, $conversationModel, $evaluation) - { - return self::getProjectLocationConversationModelEvaluationNameTemplate()->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($project, $location, $knowledgeBase, $document) - { - return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * 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] - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $conversationModel = new ConversationModel(); - * $operationResponse = $conversationModelsClient->createConversationModel($conversationModel); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationModelsClient->createConversationModel($conversationModel); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'createConversationModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param ConversationModel $conversationModel Required. The conversation model to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The project to create conversation model for. Format: - * `projects/` - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createConversationModel($conversationModel, array $optionalArgs = []) - { - $request = new CreateConversationModelRequest(); - $requestParamHeaders = []; - $request->setConversationModel($conversationModel); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateConversationModel', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates evaluation of a conversation model. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $formattedParent = $conversationModelsClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); - * $conversationModelEvaluation = new ConversationModelEvaluation(); - * $operationResponse = $conversationModelsClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationModelsClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'createConversationModelEvaluation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $parent Required. The conversation model resource name. Format: - * `projects//locations//conversationModels/` - * @param ConversationModelEvaluation $conversationModelEvaluation Required. The conversation model evaluation to be created. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createConversationModelEvaluation($parent, $conversationModelEvaluation, array $optionalArgs = []) - { - $request = new CreateConversationModelEvaluationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConversationModelEvaluation($conversationModelEvaluation); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateConversationModelEvaluation', $optionalArgs, $request, $this->getOperationsClient())->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) - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $name = 'name'; - * $operationResponse = $conversationModelsClient->deleteConversationModel($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationModelsClient->deleteConversationModel($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'deleteConversationModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation model to delete. Format: - * `projects//conversationModels/` - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteConversationModel($name, array $optionalArgs = []) - { - $request = new DeleteConversationModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteConversationModel', $optionalArgs, $request, $this->getOperationsClient())->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) - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $name = 'name'; - * $operationResponse = $conversationModelsClient->deployConversationModel($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationModelsClient->deployConversationModel($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'deployConversationModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation model to deploy. Format: - * `projects//conversationModels/` - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deployConversationModel($name, array $optionalArgs = []) - { - $request = new DeployConversationModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeployConversationModel', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets conversation model. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $name = 'name'; - * $response = $conversationModelsClient->getConversationModel($name); - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation model to retrieve. Format: - * `projects//conversationModels/` - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\ConversationModel - * - * @throws ApiException if the remote call fails - */ - public function getConversationModel($name, array $optionalArgs = []) - { - $request = new GetConversationModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConversationModel', ConversationModel::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets an evaluation of conversation model. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $name = 'name'; - * $response = $conversationModelsClient->getConversationModelEvaluation($name); - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation model evaluation resource name. Format: - * `projects//conversationModels//evaluations/` - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\ConversationModelEvaluation - * - * @throws ApiException if the remote call fails - */ - public function getConversationModelEvaluation($name, array $optionalArgs = []) - { - $request = new GetConversationModelEvaluationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConversationModelEvaluation', ConversationModelEvaluation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists evaluations of a conversation model. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $conversationModelsClient->listConversationModelEvaluations($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationModelsClient->listConversationModelEvaluations($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $parent Required. The conversation model resource name. Format: - * `projects//conversationModels/` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConversationModelEvaluations($parent, array $optionalArgs = []) - { - $request = new ListConversationModelEvaluationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConversationModelEvaluations', $optionalArgs, ListConversationModelEvaluationsResponse::class, $request); - } - - /** - * Lists conversation models. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $conversationModelsClient->listConversationModels($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationModelsClient->listConversationModels($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to list all conversation models for. - * Format: `projects/` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConversationModels($parent, array $optionalArgs = []) - { - $request = new ListConversationModelsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConversationModels', $optionalArgs, ListConversationModelsResponse::class, $request); - } - - /** - * 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) - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $name = 'name'; - * $operationResponse = $conversationModelsClient->undeployConversationModel($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationModelsClient->undeployConversationModel($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationModelsClient->resumeOperation($operationName, 'undeployConversationModel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param string $name Required. The conversation model to undeploy. Format: - * `projects//conversationModels/` - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeployConversationModel($name, array $optionalArgs = []) - { - $request = new UndeployConversationModelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UndeployConversationModel', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * $response = $conversationModelsClient->getLocation(); - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $conversationModelsClient = new ConversationModelsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $conversationModelsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationModelsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationModelsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php deleted file mode 100644 index 6b257ddf013a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php +++ /dev/null @@ -1,1389 +0,0 @@ -clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationProfilesClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationProfilesClient->resumeOperation($operationName, 'clearSuggestionFeatureConfig'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\ConversationProfilesClient} to use the new - * surface. - */ -class ConversationProfilesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationProfiles'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $cXSecuritySettingsNameTemplate; - - private static $conversationModelNameTemplate; - - private static $conversationProfileNameTemplate; - - private static $documentNameTemplate; - - private static $knowledgeBaseNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectConversationModelNameTemplate; - - private static $projectConversationProfileNameTemplate; - - private static $projectKnowledgeBaseNameTemplate; - - private static $projectKnowledgeBaseDocumentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationConversationModelNameTemplate; - - private static $projectLocationConversationProfileNameTemplate; - - private static $projectLocationKnowledgeBaseNameTemplate; - - private static $projectLocationKnowledgeBaseDocumentNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getCXSecuritySettingsNameTemplate() - { - if (self::$cXSecuritySettingsNameTemplate == null) { - self::$cXSecuritySettingsNameTemplate = new PathTemplate('projects/{project}/locations/{location}/securitySettings/{security_settings}'); - } - - return self::$cXSecuritySettingsNameTemplate; - } - - private static function getConversationModelNameTemplate() - { - if (self::$conversationModelNameTemplate == null) { - self::$conversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); - } - - return self::$conversationModelNameTemplate; - } - - private static function getConversationProfileNameTemplate() - { - if (self::$conversationProfileNameTemplate == null) { - self::$conversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); - } - - return self::$conversationProfileNameTemplate; - } - - private static function getDocumentNameTemplate() - { - if (self::$documentNameTemplate == null) { - self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$documentNameTemplate; - } - - private static function getKnowledgeBaseNameTemplate() - { - if (self::$knowledgeBaseNameTemplate == null) { - self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$knowledgeBaseNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectConversationModelNameTemplate() - { - if (self::$projectConversationModelNameTemplate == null) { - self::$projectConversationModelNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}'); - } - - return self::$projectConversationModelNameTemplate; - } - - private static function getProjectConversationProfileNameTemplate() - { - if (self::$projectConversationProfileNameTemplate == null) { - self::$projectConversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); - } - - return self::$projectConversationProfileNameTemplate; - } - - private static function getProjectKnowledgeBaseNameTemplate() - { - if (self::$projectKnowledgeBaseNameTemplate == null) { - self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectKnowledgeBaseNameTemplate; - } - - private static function getProjectKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { - self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectKnowledgeBaseDocumentNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getProjectLocationConversationModelNameTemplate() - { - if (self::$projectLocationConversationModelNameTemplate == null) { - self::$projectLocationConversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); - } - - return self::$projectLocationConversationModelNameTemplate; - } - - private static function getProjectLocationConversationProfileNameTemplate() - { - if (self::$projectLocationConversationProfileNameTemplate == null) { - self::$projectLocationConversationProfileNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}'); - } - - return self::$projectLocationConversationProfileNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseNameTemplate() - { - if (self::$projectLocationKnowledgeBaseNameTemplate == null) { - self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectLocationKnowledgeBaseNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { - self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectLocationKnowledgeBaseDocumentNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'cXSecuritySettings' => self::getCXSecuritySettingsNameTemplate(), - 'conversationModel' => self::getConversationModelNameTemplate(), - 'conversationProfile' => self::getConversationProfileNameTemplate(), - 'document' => self::getDocumentNameTemplate(), - 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectConversationModel' => self::getProjectConversationModelNameTemplate(), - 'projectConversationProfile' => self::getProjectConversationProfileNameTemplate(), - 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), - 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationConversationModel' => self::getProjectLocationConversationModelNameTemplate(), - 'projectLocationConversationProfile' => self::getProjectLocationConversationProfileNameTemplate(), - 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), - 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project, $location, $securitySettings) - { - return self::getCXSecuritySettingsNameTemplate()->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($project, $location, $conversationModel) - { - return self::getConversationModelNameTemplate()->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($project, $conversationProfile) - { - return self::getConversationProfileNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getDocumentNameTemplate()->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($project, $knowledgeBase) - { - return self::getKnowledgeBaseNameTemplate()->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($project, $location) - { - return self::getLocationNameTemplate()->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($project) - { - return self::getProjectNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $conversationModel) - { - return self::getProjectConversationModelNameTemplate()->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($project, $conversationProfile) - { - return self::getProjectConversationProfileNameTemplate()->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($project, $knowledgeBase) - { - return self::getProjectKnowledgeBaseNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->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($project, $location, $conversationModel) - { - return self::getProjectLocationConversationModelNameTemplate()->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($project, $location, $conversationProfile) - { - return self::getProjectLocationConversationProfileNameTemplate()->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($project, $location, $knowledgeBase) - { - return self::getProjectLocationKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase, $document) - { - return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - 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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * 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] - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $conversationProfile = 'conversation_profile'; - * $participantRole = Role::ROLE_UNSPECIFIED; - * $suggestionFeatureType = Type::TYPE_UNSPECIFIED; - * $operationResponse = $conversationProfilesClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationProfilesClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationProfilesClient->resumeOperation($operationName, 'clearSuggestionFeatureConfig'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @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} - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType, array $optionalArgs = []) - { - $request = new ClearSuggestionFeatureConfigRequest(); - $requestParamHeaders = []; - $request->setConversationProfile($conversationProfile); - $request->setParticipantRole($participantRole); - $request->setSuggestionFeatureType($suggestionFeatureType); - $requestParamHeaders['conversation_profile'] = $conversationProfile; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ClearSuggestionFeatureConfig', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a conversation profile in the specified project. - * - * [ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] - * aren't populated in the response. You can retrieve them via - * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] - * API. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $formattedParent = $conversationProfilesClient->projectName('[PROJECT]'); - * $conversationProfile = new ConversationProfile(); - * $response = $conversationProfilesClient->createConversationProfile($formattedParent, $conversationProfile); - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to create a conversation profile for. - * Format: `projects//locations/`. - * @param ConversationProfile $conversationProfile Required. The conversation profile to create. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\ConversationProfile - * - * @throws ApiException if the remote call fails - */ - public function createConversationProfile($parent, $conversationProfile, array $optionalArgs = []) - { - $request = new CreateConversationProfileRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConversationProfile($conversationProfile); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateConversationProfile', ConversationProfile::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the specified conversation profile. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $formattedName = $conversationProfilesClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - * $conversationProfilesClient->deleteConversationProfile($formattedName); - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the conversation profile to delete. - * Format: `projects//locations//conversationProfiles/`. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteConversationProfile($name, array $optionalArgs = []) - { - $request = new DeleteConversationProfileRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteConversationProfile', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified conversation profile. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $formattedName = $conversationProfilesClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - * $response = $conversationProfilesClient->getConversationProfile($formattedName); - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the conversation profile. - * Format: `projects//locations//conversationProfiles/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\ConversationProfile - * - * @throws ApiException if the remote call fails - */ - public function getConversationProfile($name, array $optionalArgs = []) - { - $request = new GetConversationProfileRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConversationProfile', ConversationProfile::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all conversation profiles in the specified project. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $formattedParent = $conversationProfilesClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $conversationProfilesClient->listConversationProfiles($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationProfilesClient->listConversationProfiles($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to list all conversation profiles from. - * Format: `projects//locations/`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConversationProfiles($parent, array $optionalArgs = []) - { - $request = new ListConversationProfilesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConversationProfiles', $optionalArgs, ListConversationProfilesResponse::class, $request); - } - - /** - * 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. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $conversationProfile = 'conversation_profile'; - * $participantRole = Role::ROLE_UNSPECIFIED; - * $suggestionFeatureConfig = new SuggestionFeatureConfig(); - * $operationResponse = $conversationProfilesClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $conversationProfilesClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $conversationProfilesClient->resumeOperation($operationName, 'setSuggestionFeatureConfig'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @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 SuggestionFeatureConfig $suggestionFeatureConfig Required. The suggestion feature config to add or update. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig, array $optionalArgs = []) - { - $request = new SetSuggestionFeatureConfigRequest(); - $requestParamHeaders = []; - $request->setConversationProfile($conversationProfile); - $request->setParticipantRole($participantRole); - $request->setSuggestionFeatureConfig($suggestionFeatureConfig); - $requestParamHeaders['conversation_profile'] = $conversationProfile; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('SetSuggestionFeatureConfig', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the specified conversation profile. - * - * [ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] - * aren't populated in the response. You can retrieve them via - * [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] - * API. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $conversationProfile = new ConversationProfile(); - * $updateMask = new FieldMask(); - * $response = $conversationProfilesClient->updateConversationProfile($conversationProfile, $updateMask); - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param ConversationProfile $conversationProfile Required. The conversation profile to update. - * @param FieldMask $updateMask Required. The mask to control which fields to update. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\ConversationProfile - * - * @throws ApiException if the remote call fails - */ - public function updateConversationProfile($conversationProfile, $updateMask, array $optionalArgs = []) - { - $request = new UpdateConversationProfileRequest(); - $requestParamHeaders = []; - $request->setConversationProfile($conversationProfile); - $request->setUpdateMask($updateMask); - $requestParamHeaders['conversation_profile.name'] = $conversationProfile->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateConversationProfile', ConversationProfile::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * $response = $conversationProfilesClient->getLocation(); - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $conversationProfilesClient = new ConversationProfilesClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $conversationProfilesClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationProfilesClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationProfilesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php deleted file mode 100644 index 7fd787a82291..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php +++ /dev/null @@ -1,1565 +0,0 @@ -conversationName('[PROJECT]', '[CONVERSATION]'); - * $response = $conversationsClient->completeConversation($formattedName); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\ConversationsClient} to use the new surface. - */ -class ConversationsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Conversations'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $cXSecuritySettingsNameTemplate; - - private static $conversationNameTemplate; - - private static $conversationModelNameTemplate; - - private static $conversationProfileNameTemplate; - - private static $documentNameTemplate; - - private static $knowledgeBaseNameTemplate; - - private static $locationNameTemplate; - - private static $messageNameTemplate; - - private static $projectNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectConversationNameTemplate; - - private static $projectConversationMessageNameTemplate; - - private static $projectConversationModelNameTemplate; - - private static $projectConversationProfileNameTemplate; - - private static $projectKnowledgeBaseNameTemplate; - - private static $projectKnowledgeBaseDocumentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationConversationNameTemplate; - - private static $projectLocationConversationMessageNameTemplate; - - private static $projectLocationConversationModelNameTemplate; - - private static $projectLocationConversationProfileNameTemplate; - - private static $projectLocationKnowledgeBaseNameTemplate; - - private static $projectLocationKnowledgeBaseDocumentNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getCXSecuritySettingsNameTemplate() - { - if (self::$cXSecuritySettingsNameTemplate == null) { - self::$cXSecuritySettingsNameTemplate = new PathTemplate('projects/{project}/locations/{location}/securitySettings/{security_settings}'); - } - - return self::$cXSecuritySettingsNameTemplate; - } - - private static function getConversationNameTemplate() - { - if (self::$conversationNameTemplate == null) { - self::$conversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); - } - - return self::$conversationNameTemplate; - } - - private static function getConversationModelNameTemplate() - { - if (self::$conversationModelNameTemplate == null) { - self::$conversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); - } - - return self::$conversationModelNameTemplate; - } - - private static function getConversationProfileNameTemplate() - { - if (self::$conversationProfileNameTemplate == null) { - self::$conversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); - } - - return self::$conversationProfileNameTemplate; - } - - private static function getDocumentNameTemplate() - { - if (self::$documentNameTemplate == null) { - self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$documentNameTemplate; - } - - private static function getKnowledgeBaseNameTemplate() - { - if (self::$knowledgeBaseNameTemplate == null) { - self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$knowledgeBaseNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMessageNameTemplate() - { - if (self::$messageNameTemplate == null) { - self::$messageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); - } - - return self::$messageNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectConversationNameTemplate() - { - if (self::$projectConversationNameTemplate == null) { - self::$projectConversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); - } - - return self::$projectConversationNameTemplate; - } - - private static function getProjectConversationMessageNameTemplate() - { - if (self::$projectConversationMessageNameTemplate == null) { - self::$projectConversationMessageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); - } - - return self::$projectConversationMessageNameTemplate; - } - - private static function getProjectConversationModelNameTemplate() - { - if (self::$projectConversationModelNameTemplate == null) { - self::$projectConversationModelNameTemplate = new PathTemplate('projects/{project}/conversationModels/{conversation_model}'); - } - - return self::$projectConversationModelNameTemplate; - } - - private static function getProjectConversationProfileNameTemplate() - { - if (self::$projectConversationProfileNameTemplate == null) { - self::$projectConversationProfileNameTemplate = new PathTemplate('projects/{project}/conversationProfiles/{conversation_profile}'); - } - - return self::$projectConversationProfileNameTemplate; - } - - private static function getProjectKnowledgeBaseNameTemplate() - { - if (self::$projectKnowledgeBaseNameTemplate == null) { - self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectKnowledgeBaseNameTemplate; - } - - private static function getProjectKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { - self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectKnowledgeBaseDocumentNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getProjectLocationConversationNameTemplate() - { - if (self::$projectLocationConversationNameTemplate == null) { - self::$projectLocationConversationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}'); - } - - return self::$projectLocationConversationNameTemplate; - } - - private static function getProjectLocationConversationMessageNameTemplate() - { - if (self::$projectLocationConversationMessageNameTemplate == null) { - self::$projectLocationConversationMessageNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}'); - } - - return self::$projectLocationConversationMessageNameTemplate; - } - - private static function getProjectLocationConversationModelNameTemplate() - { - if (self::$projectLocationConversationModelNameTemplate == null) { - self::$projectLocationConversationModelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationModels/{conversation_model}'); - } - - return self::$projectLocationConversationModelNameTemplate; - } - - private static function getProjectLocationConversationProfileNameTemplate() - { - if (self::$projectLocationConversationProfileNameTemplate == null) { - self::$projectLocationConversationProfileNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}'); - } - - return self::$projectLocationConversationProfileNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseNameTemplate() - { - if (self::$projectLocationKnowledgeBaseNameTemplate == null) { - self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectLocationKnowledgeBaseNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { - self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectLocationKnowledgeBaseDocumentNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'cXSecuritySettings' => self::getCXSecuritySettingsNameTemplate(), - 'conversation' => self::getConversationNameTemplate(), - 'conversationModel' => self::getConversationModelNameTemplate(), - 'conversationProfile' => self::getConversationProfileNameTemplate(), - 'document' => self::getDocumentNameTemplate(), - 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'message' => self::getMessageNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectConversation' => self::getProjectConversationNameTemplate(), - 'projectConversationMessage' => self::getProjectConversationMessageNameTemplate(), - 'projectConversationModel' => self::getProjectConversationModelNameTemplate(), - 'projectConversationProfile' => self::getProjectConversationProfileNameTemplate(), - 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), - 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationConversation' => self::getProjectLocationConversationNameTemplate(), - 'projectLocationConversationMessage' => self::getProjectLocationConversationMessageNameTemplate(), - 'projectLocationConversationModel' => self::getProjectLocationConversationModelNameTemplate(), - 'projectLocationConversationProfile' => self::getProjectLocationConversationProfileNameTemplate(), - 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), - 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project, $location, $securitySettings) - { - return self::getCXSecuritySettingsNameTemplate()->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($project, $conversation) - { - return self::getConversationNameTemplate()->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($project, $location, $conversationModel) - { - return self::getConversationModelNameTemplate()->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($project, $conversationProfile) - { - return self::getConversationProfileNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getDocumentNameTemplate()->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($project, $knowledgeBase) - { - return self::getKnowledgeBaseNameTemplate()->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($project, $location) - { - return self::getLocationNameTemplate()->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($project, $conversation, $message) - { - return self::getMessageNameTemplate()->render([ - 'project' => $project, - 'conversation' => $conversation, - 'message' => $message, - ]); - } - - /** - * 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($project) - { - return self::getProjectNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $conversation) - { - return self::getProjectConversationNameTemplate()->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($project, $conversation, $message) - { - return self::getProjectConversationMessageNameTemplate()->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($project, $conversationModel) - { - return self::getProjectConversationModelNameTemplate()->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($project, $conversationProfile) - { - return self::getProjectConversationProfileNameTemplate()->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($project, $knowledgeBase) - { - return self::getProjectKnowledgeBaseNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * 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($project, $location, $conversation) - { - return self::getProjectLocationConversationNameTemplate()->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($project, $location, $conversation, $message) - { - return self::getProjectLocationConversationMessageNameTemplate()->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($project, $location, $conversationModel) - { - return self::getProjectLocationConversationModelNameTemplate()->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($project, $location, $conversationProfile) - { - return self::getProjectLocationConversationProfileNameTemplate()->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($project, $location, $knowledgeBase) - { - return self::getProjectLocationKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase, $document) - { - return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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} - * - conversation: projects/{project}/conversations/{conversation} - * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} - * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} - * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - message: projects/{project}/conversations/{conversation}/messages/{message} - * - 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 - * - 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} - * - 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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Completes the specified conversation. Finished conversations are purged - * from the database after 30 days. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedName = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); - * $response = $conversationsClient->completeConversation($formattedName); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $name Required. Resource identifier of the conversation to close. - * Format: `projects//locations//conversations/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Conversation - * - * @throws ApiException if the remote call fails - */ - public function completeConversation($name, array $optionalArgs = []) - { - $request = new CompleteConversationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CompleteConversation', Conversation::class, $optionalArgs, $request)->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. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedParent = $conversationsClient->projectName('[PROJECT]'); - * $conversation = new Conversation(); - * $response = $conversationsClient->createConversation($formattedParent, $conversation); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource identifier of the project creating the conversation. - * Format: `projects//locations/`. - * @param Conversation $conversation Required. The conversation to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $conversationId - * 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 fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. - * If the field is provided, the caller is resposible 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. - * @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 \Google\Cloud\Dialogflow\V2\Conversation - * - * @throws ApiException if the remote call fails - */ - public function createConversation($parent, $conversation, array $optionalArgs = []) - { - $request = new CreateConversationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConversation($conversation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['conversationId'])) { - $request->setConversationId($optionalArgs['conversationId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateConversation', Conversation::class, $optionalArgs, $request)->wait(); - } - - /** - * Generates and returns a summary for a conversation that does not have a - * resource created for it. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $statelessConversation = new MinimalConversation(); - * $conversationProfile = new ConversationProfile(); - * $response = $conversationsClient->generateStatelessSummary($statelessConversation, $conversationProfile); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param MinimalConversation $statelessConversation Required. The conversation to suggest a summary for. - * @param ConversationProfile $conversationProfile Required. A ConversationProfile containing information required for Summary - * generation. - * Required fields: {language_code, security_settings} - * Optional fields: {agent_assistant_config} - * @param array $optionalArgs { - * Optional. - * - * @type string $latestMessage - * 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 $maxContextSize - * 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 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 \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse - * - * @throws ApiException if the remote call fails - */ - public function generateStatelessSummary($statelessConversation, $conversationProfile, array $optionalArgs = []) - { - $request = new GenerateStatelessSummaryRequest(); - $requestParamHeaders = []; - $request->setStatelessConversation($statelessConversation); - $request->setConversationProfile($conversationProfile); - $requestParamHeaders['stateless_conversation.parent'] = $statelessConversation->getParent(); - if (isset($optionalArgs['latestMessage'])) { - $request->setLatestMessage($optionalArgs['latestMessage']); - } - - if (isset($optionalArgs['maxContextSize'])) { - $request->setMaxContextSize($optionalArgs['maxContextSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateStatelessSummary', GenerateStatelessSummaryResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specific conversation. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedName = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); - * $response = $conversationsClient->getConversation($formattedName); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the conversation. Format: - * `projects//locations//conversations/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Conversation - * - * @throws ApiException if the remote call fails - */ - public function getConversation($name, array $optionalArgs = []) - { - $request = new GetConversationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetConversation', Conversation::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all conversations in the specified project. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedParent = $conversationsClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $conversationsClient->listConversations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationsClient->listConversations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project from which to list all conversation. - * Format: `projects//locations/`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A filter expression that filters conversations listed in the response. In - * general, the expression must specify the field name, a comparison operator, - * and the value to use for filtering: - *
    - *
  • The value must be a string, a number, or a boolean.
  • - *
  • The comparison operator must be either `=`,`!=`, `>`, or `<`.
  • - *
  • To filter on multiple expressions, separate the - * expressions with `AND` or `OR` (omitting both implies `AND`).
  • - *
  • For clarity, expressions can be enclosed in parentheses.
  • - *
- * 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). - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConversations($parent, array $optionalArgs = []) - { - $request = new ListConversationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConversations', $optionalArgs, ListConversationsResponse::class, $request); - } - - /** - * 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. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedParent = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); - * // Iterate over pages of elements - * $pagedResponse = $conversationsClient->listMessages($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationsClient->listMessages($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the conversation to list messages for. - * Format: `projects//locations//conversations/` - * @param array $optionalArgs { - * Optional. - * - * @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 $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMessages($parent, array $optionalArgs = []) - { - $request = new ListMessagesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMessages', $optionalArgs, ListMessagesResponse::class, $request); - } - - /** - * 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. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedConversation = $conversationsClient->conversationName('[PROJECT]', '[CONVERSATION]'); - * $response = $conversationsClient->suggestConversationSummary($formattedConversation); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $conversation Required. The conversation to fetch suggestion for. - * Format: `projects//locations//conversations/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $latestMessage - * 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 $contextSize - * 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 AssistQueryParameters $assistQueryParams - * Parameters for a human assist query. Only used for POC/demo purpose. - * @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 \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse - * - * @throws ApiException if the remote call fails - */ - public function suggestConversationSummary($conversation, array $optionalArgs = []) - { - $request = new SuggestConversationSummaryRequest(); - $requestParamHeaders = []; - $request->setConversation($conversation); - $requestParamHeaders['conversation'] = $conversation; - if (isset($optionalArgs['latestMessage'])) { - $request->setLatestMessage($optionalArgs['latestMessage']); - } - - if (isset($optionalArgs['contextSize'])) { - $request->setContextSize($optionalArgs['contextSize']); - } - - if (isset($optionalArgs['assistQueryParams'])) { - $request->setAssistQueryParams($optionalArgs['assistQueryParams']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SuggestConversationSummary', SuggestConversationSummaryResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $response = $conversationsClient->getLocation(); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $conversationsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $conversationsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php deleted file mode 100644 index 19c416d657f1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php +++ /dev/null @@ -1,1269 +0,0 @@ -knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - * $document = new Document(); - * $operationResponse = $documentsClient->createDocument($formattedParent, $document); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->createDocument($formattedParent, $document); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'createDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\DocumentsClient} to use the new surface. - */ -class DocumentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Documents'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $documentNameTemplate; - - private static $knowledgeBaseNameTemplate; - - private static $projectKnowledgeBaseNameTemplate; - - private static $projectKnowledgeBaseDocumentNameTemplate; - - private static $projectLocationKnowledgeBaseNameTemplate; - - private static $projectLocationKnowledgeBaseDocumentNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getDocumentNameTemplate() - { - if (self::$documentNameTemplate == null) { - self::$documentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$documentNameTemplate; - } - - private static function getKnowledgeBaseNameTemplate() - { - if (self::$knowledgeBaseNameTemplate == null) { - self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$knowledgeBaseNameTemplate; - } - - private static function getProjectKnowledgeBaseNameTemplate() - { - if (self::$projectKnowledgeBaseNameTemplate == null) { - self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectKnowledgeBaseNameTemplate; - } - - private static function getProjectKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectKnowledgeBaseDocumentNameTemplate == null) { - self::$projectKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectKnowledgeBaseDocumentNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseNameTemplate() - { - if (self::$projectLocationKnowledgeBaseNameTemplate == null) { - self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectLocationKnowledgeBaseNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseDocumentNameTemplate() - { - if (self::$projectLocationKnowledgeBaseDocumentNameTemplate == null) { - self::$projectLocationKnowledgeBaseDocumentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}'); - } - - return self::$projectLocationKnowledgeBaseDocumentNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'document' => self::getDocumentNameTemplate(), - 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), - 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), - 'projectKnowledgeBaseDocument' => self::getProjectKnowledgeBaseDocumentNameTemplate(), - 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), - 'projectLocationKnowledgeBaseDocument' => self::getProjectLocationKnowledgeBaseDocumentNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $knowledgeBase, $document) - { - return self::getDocumentNameTemplate()->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($project, $knowledgeBase) - { - return self::getKnowledgeBaseNameTemplate()->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($project, $knowledgeBase) - { - return self::getProjectKnowledgeBaseNameTemplate()->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($project, $knowledgeBase, $document) - { - return self::getProjectKnowledgeBaseDocumentNameTemplate()->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($project, $location, $knowledgeBase) - { - return self::getProjectLocationKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase, $document) - { - return self::getProjectLocationKnowledgeBaseDocumentNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * 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] - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedParent = $documentsClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - * $document = new Document(); - * $operationResponse = $documentsClient->createDocument($formattedParent, $document); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->createDocument($formattedParent, $document); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'createDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The knowledge base to create a document for. - * Format: `projects//locations//knowledgeBases/`. - * @param Document $document Required. The document to create. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDocument($parent, $document, array $optionalArgs = []) - { - $request = new CreateDocumentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDocument($document); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateDocument', $optionalArgs, $request, $this->getOperationsClient())->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) - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - * $operationResponse = $documentsClient->deleteDocument($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->deleteDocument($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'deleteDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the document to delete. - * Format: `projects//locations//knowledgeBases//documents/`. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDocument($name, array $optionalArgs = []) - { - $request = new DeleteDocumentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteDocument', $optionalArgs, $request, $this->getOperationsClient())->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] - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - * $operationResponse = $documentsClient->exportDocument($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->exportDocument($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'exportDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the document to export. - * Format: `projects//locations//knowledgeBases//documents/`. - * @param array $optionalArgs { - * Optional. - * - * @type GcsDestination $gcsDestination - * Cloud Storage file path to export the document. - * @type bool $exportFullContent - * When enabled, export the full content of the document including empirical - * probability. - * @type bool $smartMessagingPartialUpdate - * When enabled, export the smart messaging allowlist document for partial - * update. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportDocument($name, array $optionalArgs = []) - { - $request = new ExportDocumentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['gcsDestination'])) { - $request->setGcsDestination($optionalArgs['gcsDestination']); - } - - if (isset($optionalArgs['exportFullContent'])) { - $request->setExportFullContent($optionalArgs['exportFullContent']); - } - - if (isset($optionalArgs['smartMessagingPartialUpdate'])) { - $request->setSmartMessagingPartialUpdate($optionalArgs['smartMessagingPartialUpdate']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Retrieves the specified document. - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - * $response = $documentsClient->getDocument($formattedName); - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the document to retrieve. - * Format `projects//locations//knowledgeBases//documents/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Document - * - * @throws ApiException if the remote call fails - */ - public function getDocument($name, array $optionalArgs = []) - { - $request = new GetDocumentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetDocument', Document::class, $optionalArgs, $request)->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] - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedParent = $documentsClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - * $documentTemplate = new ImportDocumentTemplate(); - * $operationResponse = $documentsClient->importDocuments($formattedParent, $documentTemplate); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->importDocuments($formattedParent, $documentTemplate); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'importDocuments'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The knowledge base to import documents into. - * Format: `projects//locations//knowledgeBases/`. - * @param ImportDocumentTemplate $documentTemplate Required. Document template used for importing all the documents. - * @param array $optionalArgs { - * Optional. - * - * @type GcsSources $gcsSource - * Optional. The Google Cloud Storage location for the documents. - * The path can include a wildcard. - * - * These URIs may have the forms - * `gs:///`. - * `gs:////*.`. - * @type bool $importGcsCustomMetadata - * Whether to import custom metadata from Google Cloud Storage. - * Only valid when the document source is Google Cloud Storage URI. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importDocuments($parent, $documentTemplate, array $optionalArgs = []) - { - $request = new ImportDocumentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDocumentTemplate($documentTemplate); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['gcsSource'])) { - $request->setGcsSource($optionalArgs['gcsSource']); - } - - if (isset($optionalArgs['importGcsCustomMetadata'])) { - $request->setImportGcsCustomMetadata($optionalArgs['importGcsCustomMetadata']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Returns the list of all documents of the knowledge base. - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedParent = $documentsClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - * // Iterate over pages of elements - * $pagedResponse = $documentsClient->listDocuments($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentsClient->listDocuments($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The knowledge base to list all documents for. - * Format: `projects//locations//knowledgeBases/`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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). - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDocuments($parent, array $optionalArgs = []) - { - $request = new ListDocumentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListDocuments', $optionalArgs, ListDocumentsResponse::class, $request); - } - - /** - * 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`. - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $formattedName = $documentsClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - * $operationResponse = $documentsClient->reloadDocument($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->reloadDocument($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'reloadDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the document to reload. - * Format: `projects//locations//knowledgeBases//documents/` - * @param array $optionalArgs { - * Optional. - * - * @type 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:///`. - * @type bool $importGcsCustomMetadata - * Optional. Whether to import custom metadata from Google Cloud Storage. - * Only valid when the document source is Google Cloud Storage URI. - * @type bool $smartMessagingPartialUpdate - * Optional. When enabled, the reload request is to apply partial update to - * the smart messaging allowlist. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function reloadDocument($name, array $optionalArgs = []) - { - $request = new ReloadDocumentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['contentUri'])) { - $request->setContentUri($optionalArgs['contentUri']); - } - - if (isset($optionalArgs['importGcsCustomMetadata'])) { - $request->setImportGcsCustomMetadata($optionalArgs['importGcsCustomMetadata']); - } - - if (isset($optionalArgs['smartMessagingPartialUpdate'])) { - $request->setSmartMessagingPartialUpdate($optionalArgs['smartMessagingPartialUpdate']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ReloadDocument', $optionalArgs, $request, $this->getOperationsClient())->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] - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $document = new Document(); - * $operationResponse = $documentsClient->updateDocument($document); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentsClient->updateDocument($document); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentsClient->resumeOperation($operationName, 'updateDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param Document $document Required. The document to update. - * @param array $optionalArgs { - * Optional. - * - * @type 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. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDocument($document, array $optionalArgs = []) - { - $request = new UpdateDocumentRequest(); - $requestParamHeaders = []; - $request->setDocument($document); - $requestParamHeaders['document.name'] = $document->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * $response = $documentsClient->getLocation(); - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $documentsClient = new DocumentsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $documentsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php deleted file mode 100644 index fa66e2802cce..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php +++ /dev/null @@ -1,1346 +0,0 @@ -entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - * $entities = []; - * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchCreateEntities'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\EntityTypesClient} to use the new surface. - */ -class EntityTypesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.EntityTypes'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $entityTypeNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectEntityTypeNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationEntityTypeNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getEntityTypeNameTemplate() - { - if (self::$entityTypeNameTemplate == null) { - self::$entityTypeNameTemplate = new PathTemplate('projects/{project}/agent/entityTypes/{entity_type}'); - } - - return self::$entityTypeNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectEntityTypeNameTemplate() - { - if (self::$projectEntityTypeNameTemplate == null) { - self::$projectEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/entityTypes/{entity_type}'); - } - - return self::$projectEntityTypeNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getProjectLocationEntityTypeNameTemplate() - { - if (self::$projectLocationEntityTypeNameTemplate == null) { - self::$projectLocationEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/entityTypes/{entity_type}'); - } - - return self::$projectLocationEntityTypeNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'entityType' => self::getEntityTypeNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectEntityType' => self::getProjectEntityTypeNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationEntityType' => self::getProjectLocationEntityTypeNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project, $entityType) - { - return self::getEntityTypeNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $entityType) - { - return self::getProjectEntityTypeNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->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($project, $location, $entityType) - { - return self::getProjectLocationEntityTypeNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * 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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - * $entities = []; - * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $entityTypesClient->batchCreateEntities($formattedParent, $entities); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchCreateEntities'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the entity type to create entities in. Format: - * `projects//agent/entityTypes/`. - * @param Entity[] $entities Required. The entities to create. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateEntities($parent, $entities, array $optionalArgs = []) - { - $request = new BatchCreateEntitiesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntities($entities); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchCreateEntities', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - * $entityValues = []; - * $operationResponse = $entityTypesClient->batchDeleteEntities($formattedParent, $entityValues); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $entityTypesClient->batchDeleteEntities($formattedParent, $entityValues); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchDeleteEntities'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the entity type to delete entries for. Format: - * `projects//agent/entityTypes/`. - * @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 array $optionalArgs { - * Optional. - * - * @type 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). - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchDeleteEntities($parent, $entityValues, array $optionalArgs = []) - { - $request = new BatchDeleteEntitiesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntityValues($entityValues); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchDeleteEntities', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); - * $entityTypeNames = []; - * $operationResponse = $entityTypesClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $entityTypesClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchDeleteEntityTypes'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the agent to delete all entities types for. Format: - * `projects//agent`. - * @param string[] $entityTypeNames Required. The names entity types to delete. All names must point to the - * same agent as `parent`. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchDeleteEntityTypes($parent, $entityTypeNames, array $optionalArgs = []) - { - $request = new BatchDeleteEntityTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntityTypeNames($entityTypeNames); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchDeleteEntityTypes', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - * $entities = []; - * $operationResponse = $entityTypesClient->batchUpdateEntities($formattedParent, $entities); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $entityTypesClient->batchUpdateEntities($formattedParent, $entities); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchUpdateEntities'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the entity type to update or create entities in. - * Format: `projects//agent/entityTypes/`. - * @param Entity[] $entities Required. The entities to update or create. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchUpdateEntities($parent, $entities, array $optionalArgs = []) - { - $request = new BatchUpdateEntitiesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntities($entities); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchUpdateEntities', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); - * $operationResponse = $entityTypesClient->batchUpdateEntityTypes($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $entityTypesClient->batchUpdateEntityTypes($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $entityTypesClient->resumeOperation($operationName, 'batchUpdateEntityTypes'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the agent to update or create entity types in. - * Format: `projects//agent`. - * @param array $optionalArgs { - * Optional. - * - * @type string $entityTypeBatchUri - * 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 EntityTypeBatch $entityTypeBatchInline - * The collection of entity types to update or create. - * @type 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). - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchUpdateEntityTypes($parent, array $optionalArgs = []) - { - $request = new BatchUpdateEntityTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['entityTypeBatchUri'])) { - $request->setEntityTypeBatchUri($optionalArgs['entityTypeBatchUri']); - } - - if (isset($optionalArgs['entityTypeBatchInline'])) { - $request->setEntityTypeBatchInline($optionalArgs['entityTypeBatchInline']); - } - - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchUpdateEntityTypes', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); - * $entityType = new EntityType(); - * $response = $entityTypesClient->createEntityType($formattedParent, $entityType); - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to create a entity type for. - * Format: `projects//agent`. - * @param EntityType $entityType Required. The entity type to create. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @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 \Google\Cloud\Dialogflow\V2\EntityType - * - * @throws ApiException if the remote call fails - */ - public function createEntityType($parent, $entityType, array $optionalArgs = []) - { - $request = new CreateEntityTypeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEntityType($entityType); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateEntityType', EntityType::class, $optionalArgs, $request)->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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedName = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - * $entityTypesClient->deleteEntityType($formattedName); - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the entity type to delete. - * Format: `projects//agent/entityTypes/`. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteEntityType($name, array $optionalArgs = []) - { - $request = new DeleteEntityTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteEntityType', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified entity type. - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedName = $entityTypesClient->entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - * $response = $entityTypesClient->getEntityType($formattedName); - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the entity type. - * Format: `projects//agent/entityTypes/`. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @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 \Google\Cloud\Dialogflow\V2\EntityType - * - * @throws ApiException if the remote call fails - */ - public function getEntityType($name, array $optionalArgs = []) - { - $request = new GetEntityTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEntityType', EntityType::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all entity types in the specified agent. - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $formattedParent = $entityTypesClient->agentName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $entityTypesClient->listEntityTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $entityTypesClient->listEntityTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to list all entity types from. - * Format: `projects//agent`. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEntityTypes($parent, array $optionalArgs = []) - { - $request = new ListEntityTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEntityTypes', $optionalArgs, ListEntityTypesResponse::class, $request); - } - - /** - * 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). - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $entityType = new EntityType(); - * $response = $entityTypesClient->updateEntityType($entityType); - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param EntityType $entityType Required. The entity type to update. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @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 \Google\Cloud\Dialogflow\V2\EntityType - * - * @throws ApiException if the remote call fails - */ - public function updateEntityType($entityType, array $optionalArgs = []) - { - $request = new UpdateEntityTypeRequest(); - $requestParamHeaders = []; - $request->setEntityType($entityType); - $requestParamHeaders['entity_type.name'] = $entityType->getName(); - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateEntityType', EntityType::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * $response = $entityTypesClient->getLocation(); - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $entityTypesClient = new EntityTypesClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $entityTypesClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $entityTypesClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $entityTypesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php deleted file mode 100644 index b3593b208ad6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php +++ /dev/null @@ -1,1054 +0,0 @@ -agentName('[PROJECT]'); - * $environment = new Environment(); - * $environmentId = 'environment_id'; - * $response = $environmentsClient->createEnvironment($formattedParent, $environment, $environmentId); - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\EnvironmentsClient} to use the new surface. - */ -class EnvironmentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Environments'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $environmentNameTemplate; - - private static $fulfillmentNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectEnvironmentNameTemplate; - - private static $projectFulfillmentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationEnvironmentNameTemplate; - - private static $projectLocationFulfillmentNameTemplate; - - private static $projectLocationVersionNameTemplate; - - private static $projectVersionNameTemplate; - - private static $versionNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getEnvironmentNameTemplate() - { - if (self::$environmentNameTemplate == null) { - self::$environmentNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}'); - } - - return self::$environmentNameTemplate; - } - - private static function getFulfillmentNameTemplate() - { - if (self::$fulfillmentNameTemplate == null) { - self::$fulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); - } - - return self::$fulfillmentNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectEnvironmentNameTemplate() - { - if (self::$projectEnvironmentNameTemplate == null) { - self::$projectEnvironmentNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}'); - } - - return self::$projectEnvironmentNameTemplate; - } - - private static function getProjectFulfillmentNameTemplate() - { - if (self::$projectFulfillmentNameTemplate == null) { - self::$projectFulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); - } - - return self::$projectFulfillmentNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getProjectLocationEnvironmentNameTemplate() - { - if (self::$projectLocationEnvironmentNameTemplate == null) { - self::$projectLocationEnvironmentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}'); - } - - return self::$projectLocationEnvironmentNameTemplate; - } - - private static function getProjectLocationFulfillmentNameTemplate() - { - if (self::$projectLocationFulfillmentNameTemplate == null) { - self::$projectLocationFulfillmentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/fulfillment'); - } - - return self::$projectLocationFulfillmentNameTemplate; - } - - private static function getProjectLocationVersionNameTemplate() - { - if (self::$projectLocationVersionNameTemplate == null) { - self::$projectLocationVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/versions/{version}'); - } - - return self::$projectLocationVersionNameTemplate; - } - - private static function getProjectVersionNameTemplate() - { - if (self::$projectVersionNameTemplate == null) { - self::$projectVersionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); - } - - return self::$projectVersionNameTemplate; - } - - private static function getVersionNameTemplate() - { - if (self::$versionNameTemplate == null) { - self::$versionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); - } - - return self::$versionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'environment' => self::getEnvironmentNameTemplate(), - 'fulfillment' => self::getFulfillmentNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectEnvironment' => self::getProjectEnvironmentNameTemplate(), - 'projectFulfillment' => self::getProjectFulfillmentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationEnvironment' => self::getProjectLocationEnvironmentNameTemplate(), - 'projectLocationFulfillment' => self::getProjectLocationFulfillmentNameTemplate(), - 'projectLocationVersion' => self::getProjectLocationVersionNameTemplate(), - 'projectVersion' => self::getProjectVersionNameTemplate(), - 'version' => self::getVersionNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project, $environment) - { - return self::getEnvironmentNameTemplate()->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($project) - { - return self::getFulfillmentNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $environment) - { - return self::getProjectEnvironmentNameTemplate()->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($project) - { - return self::getProjectFulfillmentNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->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($project, $location, $environment) - { - return self::getProjectLocationEnvironmentNameTemplate()->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($project, $location) - { - return self::getProjectLocationFulfillmentNameTemplate()->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($project, $location, $version) - { - return self::getProjectLocationVersionNameTemplate()->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($project, $version) - { - return self::getProjectVersionNameTemplate()->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($project, $version) - { - return self::getVersionNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates an agent environment. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $formattedParent = $environmentsClient->agentName('[PROJECT]'); - * $environment = new Environment(); - * $environmentId = 'environment_id'; - * $response = $environmentsClient->createEnvironment($formattedParent, $environment, $environmentId); - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to create an environment for. - * Supported formats: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param Environment $environment Required. The environment to create. - * @param string $environmentId Required. The unique id of the new environment. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Environment - * - * @throws ApiException if the remote call fails - */ - public function createEnvironment($parent, $environment, $environmentId, array $optionalArgs = []) - { - $request = new CreateEnvironmentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEnvironment($environment); - $request->setEnvironmentId($environmentId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateEnvironment', Environment::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the specified agent environment. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $formattedName = $environmentsClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); - * $environmentsClient->deleteEnvironment($formattedName); - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param 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 `-`. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteEnvironment($name, array $optionalArgs = []) - { - $request = new DeleteEnvironmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteEnvironment', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified agent environment. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $formattedName = $environmentsClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); - * $response = $environmentsClient->getEnvironment($formattedName); - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param 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 `-`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Environment - * - * @throws ApiException if the remote call fails - */ - public function getEnvironment($name, array $optionalArgs = []) - { - $request = new GetEnvironmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEnvironment', Environment::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the history of the specified environment. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $formattedParent = $environmentsClient->environmentName('[PROJECT]', '[ENVIRONMENT]'); - * // Iterate over pages of elements - * $pagedResponse = $environmentsClient->getEnvironmentHistory($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $environmentsClient->getEnvironmentHistory($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param 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 `-`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function getEnvironmentHistory($parent, array $optionalArgs = []) - { - $request = new GetEnvironmentHistoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('GetEnvironmentHistory', $optionalArgs, EnvironmentHistory::class, $request); - } - - /** - * Returns the list of all non-default environments of the specified agent. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $formattedParent = $environmentsClient->agentName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $environmentsClient->listEnvironments($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $environmentsClient->listEnvironments($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to list all environments from. - * Format: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEnvironments($parent, array $optionalArgs = []) - { - $request = new ListEnvironmentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEnvironments', $optionalArgs, ListEnvironmentsResponse::class, $request); - } - - /** - * 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. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $environment = new Environment(); - * $updateMask = new FieldMask(); - * $response = $environmentsClient->updateEnvironment($environment, $updateMask); - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param Environment $environment Required. The environment to update. - * @param FieldMask $updateMask Required. The mask to control which fields get updated. - * @param array $optionalArgs { - * Optional. - * - * @type bool $allowLoadToDraftAndDiscardChanges - * 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 = `-`). - * @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 \Google\Cloud\Dialogflow\V2\Environment - * - * @throws ApiException if the remote call fails - */ - public function updateEnvironment($environment, $updateMask, array $optionalArgs = []) - { - $request = new UpdateEnvironmentRequest(); - $requestParamHeaders = []; - $request->setEnvironment($environment); - $request->setUpdateMask($updateMask); - $requestParamHeaders['environment.name'] = $environment->getName(); - if (isset($optionalArgs['allowLoadToDraftAndDiscardChanges'])) { - $request->setAllowLoadToDraftAndDiscardChanges($optionalArgs['allowLoadToDraftAndDiscardChanges']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateEnvironment', Environment::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * $response = $environmentsClient->getLocation(); - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $environmentsClient = new EnvironmentsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $environmentsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $environmentsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $environmentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php deleted file mode 100644 index b0ca0504ae53..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php +++ /dev/null @@ -1,510 +0,0 @@ -fulfillmentName('[PROJECT]'); - * $response = $fulfillmentsClient->getFulfillment($formattedName); - * } finally { - * $fulfillmentsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\FulfillmentsClient} to use the new surface. - */ -class FulfillmentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Fulfillments'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $fulfillmentNameTemplate; - - private static $projectFulfillmentNameTemplate; - - private static $projectLocationFulfillmentNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getFulfillmentNameTemplate() - { - if (self::$fulfillmentNameTemplate == null) { - self::$fulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); - } - - return self::$fulfillmentNameTemplate; - } - - private static function getProjectFulfillmentNameTemplate() - { - if (self::$projectFulfillmentNameTemplate == null) { - self::$projectFulfillmentNameTemplate = new PathTemplate('projects/{project}/agent/fulfillment'); - } - - return self::$projectFulfillmentNameTemplate; - } - - private static function getProjectLocationFulfillmentNameTemplate() - { - if (self::$projectLocationFulfillmentNameTemplate == null) { - self::$projectLocationFulfillmentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/fulfillment'); - } - - return self::$projectLocationFulfillmentNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'fulfillment' => self::getFulfillmentNameTemplate(), - 'projectFulfillment' => self::getProjectFulfillmentNameTemplate(), - 'projectLocationFulfillment' => self::getProjectLocationFulfillmentNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getFulfillmentNameTemplate()->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($project) - { - return self::getProjectFulfillmentNameTemplate()->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($project, $location) - { - return self::getProjectLocationFulfillmentNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Retrieves the fulfillment. - * - * Sample code: - * ``` - * $fulfillmentsClient = new FulfillmentsClient(); - * try { - * $formattedName = $fulfillmentsClient->fulfillmentName('[PROJECT]'); - * $response = $fulfillmentsClient->getFulfillment($formattedName); - * } finally { - * $fulfillmentsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the fulfillment. - * Format: `projects//agent/fulfillment`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Fulfillment - * - * @throws ApiException if the remote call fails - */ - public function getFulfillment($name, array $optionalArgs = []) - { - $request = new GetFulfillmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFulfillment', Fulfillment::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates the fulfillment. - * - * Sample code: - * ``` - * $fulfillmentsClient = new FulfillmentsClient(); - * try { - * $fulfillment = new Fulfillment(); - * $updateMask = new FieldMask(); - * $response = $fulfillmentsClient->updateFulfillment($fulfillment, $updateMask); - * } finally { - * $fulfillmentsClient->close(); - * } - * ``` - * - * @param Fulfillment $fulfillment Required. The fulfillment to update. - * @param FieldMask $updateMask Required. The mask to control which fields get updated. If the mask is not - * present, all fields will be updated. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Fulfillment - * - * @throws ApiException if the remote call fails - */ - public function updateFulfillment($fulfillment, $updateMask, array $optionalArgs = []) - { - $request = new UpdateFulfillmentRequest(); - $requestParamHeaders = []; - $request->setFulfillment($fulfillment); - $request->setUpdateMask($updateMask); - $requestParamHeaders['fulfillment.name'] = $fulfillment->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateFulfillment', Fulfillment::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $fulfillmentsClient = new FulfillmentsClient(); - * try { - * $response = $fulfillmentsClient->getLocation(); - * } finally { - * $fulfillmentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $fulfillmentsClient = new FulfillmentsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $fulfillmentsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $fulfillmentsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $fulfillmentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php deleted file mode 100644 index 8604b2960ec9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php +++ /dev/null @@ -1,1441 +0,0 @@ -agentName('[PROJECT]'); - * $intents = []; - * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $intentsClient->resumeOperation($operationName, 'batchDeleteIntents'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\IntentsClient} to use the new surface. - */ -class IntentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Intents'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $contextNameTemplate; - - private static $intentNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectEnvironmentUserSessionNameTemplate; - - private static $projectEnvironmentUserSessionContextNameTemplate; - - private static $projectIntentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationEnvironmentUserSessionNameTemplate; - - private static $projectLocationEnvironmentUserSessionContextNameTemplate; - - private static $projectLocationIntentNameTemplate; - - private static $projectLocationSessionNameTemplate; - - private static $projectLocationSessionContextNameTemplate; - - private static $projectSessionNameTemplate; - - private static $projectSessionContextNameTemplate; - - private static $sessionNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$contextNameTemplate; - } - - private static function getIntentNameTemplate() - { - if (self::$intentNameTemplate == null) { - self::$intentNameTemplate = new PathTemplate('projects/{project}/agent/intents/{intent}'); - } - - return self::$intentNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectEnvironmentUserSessionNameTemplate() - { - if (self::$projectEnvironmentUserSessionNameTemplate == null) { - self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectEnvironmentUserSessionNameTemplate; - } - - private static function getProjectEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { - self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectIntentNameTemplate() - { - if (self::$projectIntentNameTemplate == null) { - self::$projectIntentNameTemplate = new PathTemplate('projects/{project}/agent/intents/{intent}'); - } - - return self::$projectIntentNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectLocationEnvironmentUserSessionNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectLocationIntentNameTemplate() - { - if (self::$projectLocationIntentNameTemplate == null) { - self::$projectLocationIntentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/intents/{intent}'); - } - - return self::$projectLocationIntentNameTemplate; - } - - private static function getProjectLocationSessionNameTemplate() - { - if (self::$projectLocationSessionNameTemplate == null) { - self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); - } - - return self::$projectLocationSessionNameTemplate; - } - - private static function getProjectLocationSessionContextNameTemplate() - { - if (self::$projectLocationSessionContextNameTemplate == null) { - self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationSessionContextNameTemplate; - } - - private static function getProjectSessionNameTemplate() - { - if (self::$projectSessionNameTemplate == null) { - self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$projectSessionNameTemplate; - } - - private static function getProjectSessionContextNameTemplate() - { - if (self::$projectSessionContextNameTemplate == null) { - self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectSessionContextNameTemplate; - } - - private static function getSessionNameTemplate() - { - if (self::$sessionNameTemplate == null) { - self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$sessionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'context' => self::getContextNameTemplate(), - 'intent' => self::getIntentNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), - 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), - 'projectIntent' => self::getProjectIntentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), - 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), - 'projectLocationIntent' => self::getProjectLocationIntentNameTemplate(), - 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), - 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), - 'projectSession' => self::getProjectSessionNameTemplate(), - 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), - 'session' => self::getSessionNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project, $session, $context) - { - return self::getContextNameTemplate()->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($project, $intent) - { - return self::getIntentNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $environment, $user, $session) - { - return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) - { - return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $intent) - { - return self::getProjectIntentNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->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($project, $location, $environment, $user, $session) - { - return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) - { - return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $intent) - { - return self::getProjectLocationIntentNameTemplate()->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($project, $location, $session) - { - return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) - { - return self::getProjectLocationSessionContextNameTemplate()->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($project, $session) - { - return self::getProjectSessionNameTemplate()->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($project, $session, $context) - { - return self::getProjectSessionContextNameTemplate()->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($project, $session) - { - return self::getSessionNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * 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). - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $formattedParent = $intentsClient->agentName('[PROJECT]'); - * $intents = []; - * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $intentsClient->batchDeleteIntents($formattedParent, $intents); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $intentsClient->resumeOperation($operationName, 'batchDeleteIntents'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the agent to delete all entities types for. Format: - * `projects//agent`. - * @param Intent[] $intents Required. The collection of intents to delete. Only intent `name` must be - * filled in. - * @param array $optionalArgs { - * 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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchDeleteIntents($parent, $intents, array $optionalArgs = []) - { - $request = new BatchDeleteIntentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setIntents($intents); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchDeleteIntents', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $formattedParent = $intentsClient->agentName('[PROJECT]'); - * $operationResponse = $intentsClient->batchUpdateIntents($formattedParent); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $intentsClient->batchUpdateIntents($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $intentsClient->resumeOperation($operationName, 'batchUpdateIntents'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the agent to update or create intents in. - * Format: `projects//agent`. - * @param array $optionalArgs { - * Optional. - * - * @type 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://". - * @type IntentBatch $intentBatchInline - * The collection of intents to update or create. - * @type 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). - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @type int $intentView - * Optional. The resource view to apply to the returned intent. - * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchUpdateIntents($parent, array $optionalArgs = []) - { - $request = new BatchUpdateIntentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['intentBatchUri'])) { - $request->setIntentBatchUri($optionalArgs['intentBatchUri']); - } - - if (isset($optionalArgs['intentBatchInline'])) { - $request->setIntentBatchInline($optionalArgs['intentBatchInline']); - } - - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['intentView'])) { - $request->setIntentView($optionalArgs['intentView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchUpdateIntents', $optionalArgs, $request, $this->getOperationsClient())->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). - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $formattedParent = $intentsClient->agentName('[PROJECT]'); - * $intent = new Intent(); - * $response = $intentsClient->createIntent($formattedParent, $intent); - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to create a intent for. - * Format: `projects//agent`. - * @param Intent $intent Required. The intent to create. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type int $intentView - * Optional. The resource view to apply to the returned intent. - * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} - * @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 \Google\Cloud\Dialogflow\V2\Intent - * - * @throws ApiException if the remote call fails - */ - public function createIntent($parent, $intent, array $optionalArgs = []) - { - $request = new CreateIntentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setIntent($intent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['intentView'])) { - $request->setIntentView($optionalArgs['intentView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateIntent', Intent::class, $optionalArgs, $request)->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). - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $formattedName = $intentsClient->intentName('[PROJECT]', '[INTENT]'); - * $intentsClient->deleteIntent($formattedName); - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @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/`. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteIntent($name, array $optionalArgs = []) - { - $request = new DeleteIntentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteIntent', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified intent. - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $formattedName = $intentsClient->intentName('[PROJECT]', '[INTENT]'); - * $response = $intentsClient->getIntent($formattedName); - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the intent. - * Format: `projects//agent/intents/`. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type int $intentView - * Optional. The resource view to apply to the returned intent. - * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} - * @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 \Google\Cloud\Dialogflow\V2\Intent - * - * @throws ApiException if the remote call fails - */ - public function getIntent($name, array $optionalArgs = []) - { - $request = new GetIntentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['intentView'])) { - $request->setIntentView($optionalArgs['intentView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIntent', Intent::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all intents in the specified agent. - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $formattedParent = $intentsClient->agentName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $intentsClient->listIntents($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $intentsClient->listIntents($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type int $intentView - * Optional. The resource view to apply to the returned intent. - * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listIntents($parent, array $optionalArgs = []) - { - $request = new ListIntentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['intentView'])) { - $request->setIntentView($optionalArgs['intentView']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListIntents', $optionalArgs, ListIntentsResponse::class, $request); - } - - /** - * 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). - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $intent = new Intent(); - * $response = $intentsClient->updateIntent($intent); - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param Intent $intent Required. The intent to update. - * @param array $optionalArgs { - * Optional. - * - * @type 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). - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @type int $intentView - * Optional. The resource view to apply to the returned intent. - * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\IntentView} - * @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 \Google\Cloud\Dialogflow\V2\Intent - * - * @throws ApiException if the remote call fails - */ - public function updateIntent($intent, array $optionalArgs = []) - { - $request = new UpdateIntentRequest(); - $requestParamHeaders = []; - $request->setIntent($intent); - $requestParamHeaders['intent.name'] = $intent->getName(); - if (isset($optionalArgs['languageCode'])) { - $request->setLanguageCode($optionalArgs['languageCode']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['intentView'])) { - $request->setIntentView($optionalArgs['intentView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateIntent', Intent::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * $response = $intentsClient->getLocation(); - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $intentsClient = new IntentsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $intentsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $intentsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $intentsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php deleted file mode 100644 index 699e847ebefa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php +++ /dev/null @@ -1,775 +0,0 @@ -projectName('[PROJECT]'); - * $knowledgeBase = new KnowledgeBase(); - * $response = $knowledgeBasesClient->createKnowledgeBase($formattedParent, $knowledgeBase); - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\KnowledgeBasesClient} to use the new surface. - */ -class KnowledgeBasesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.KnowledgeBases'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $knowledgeBaseNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $projectKnowledgeBaseNameTemplate; - - private static $projectLocationKnowledgeBaseNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getKnowledgeBaseNameTemplate() - { - if (self::$knowledgeBaseNameTemplate == null) { - self::$knowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$knowledgeBaseNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectKnowledgeBaseNameTemplate() - { - if (self::$projectKnowledgeBaseNameTemplate == null) { - self::$projectKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectKnowledgeBaseNameTemplate; - } - - private static function getProjectLocationKnowledgeBaseNameTemplate() - { - if (self::$projectLocationKnowledgeBaseNameTemplate == null) { - self::$projectLocationKnowledgeBaseNameTemplate = new PathTemplate('projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}'); - } - - return self::$projectLocationKnowledgeBaseNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'knowledgeBase' => self::getKnowledgeBaseNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectKnowledgeBase' => self::getProjectKnowledgeBaseNameTemplate(), - 'projectLocationKnowledgeBase' => self::getProjectLocationKnowledgeBaseNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $knowledgeBase) - { - return self::getKnowledgeBaseNameTemplate()->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($project, $location) - { - return self::getLocationNameTemplate()->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($project) - { - return self::getProjectNameTemplate()->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($project, $knowledgeBase) - { - return self::getProjectKnowledgeBaseNameTemplate()->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($project, $location, $knowledgeBase) - { - return self::getProjectLocationKnowledgeBaseNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a knowledge base. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * $formattedParent = $knowledgeBasesClient->projectName('[PROJECT]'); - * $knowledgeBase = new KnowledgeBase(); - * $response = $knowledgeBasesClient->createKnowledgeBase($formattedParent, $knowledgeBase); - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to create a knowledge base for. - * Format: `projects//locations/`. - * @param KnowledgeBase $knowledgeBase Required. The knowledge base to create. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\KnowledgeBase - * - * @throws ApiException if the remote call fails - */ - public function createKnowledgeBase($parent, $knowledgeBase, array $optionalArgs = []) - { - $request = new CreateKnowledgeBaseRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setKnowledgeBase($knowledgeBase); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateKnowledgeBase', KnowledgeBase::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the specified knowledge base. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * $formattedName = $knowledgeBasesClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - * $knowledgeBasesClient->deleteKnowledgeBase($formattedName); - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the knowledge base to delete. - * Format: `projects//locations//knowledgeBases/`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * Optional. Force deletes the knowledge base. When set to true, any documents - * in the knowledge base are also deleted. - * @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 if the remote call fails - */ - public function deleteKnowledgeBase($name, array $optionalArgs = []) - { - $request = new DeleteKnowledgeBaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteKnowledgeBase', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified knowledge base. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * $formattedName = $knowledgeBasesClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - * $response = $knowledgeBasesClient->getKnowledgeBase($formattedName); - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the knowledge base to retrieve. - * Format `projects//locations//knowledgeBases/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\KnowledgeBase - * - * @throws ApiException if the remote call fails - */ - public function getKnowledgeBase($name, array $optionalArgs = []) - { - $request = new GetKnowledgeBaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetKnowledgeBase', KnowledgeBase::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all knowledge bases of the specified agent. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * $formattedParent = $knowledgeBasesClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $knowledgeBasesClient->listKnowledgeBases($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $knowledgeBasesClient->listKnowledgeBases($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param string $parent Required. The project to list of knowledge bases for. - * Format: `projects//locations/`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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). - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listKnowledgeBases($parent, array $optionalArgs = []) - { - $request = new ListKnowledgeBasesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListKnowledgeBases', $optionalArgs, ListKnowledgeBasesResponse::class, $request); - } - - /** - * Updates the specified knowledge base. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * $knowledgeBase = new KnowledgeBase(); - * $response = $knowledgeBasesClient->updateKnowledgeBase($knowledgeBase); - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param KnowledgeBase $knowledgeBase Required. The knowledge base to update. - * @param array $optionalArgs { - * Optional. - * - * @type 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. - * @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 \Google\Cloud\Dialogflow\V2\KnowledgeBase - * - * @throws ApiException if the remote call fails - */ - public function updateKnowledgeBase($knowledgeBase, array $optionalArgs = []) - { - $request = new UpdateKnowledgeBaseRequest(); - $requestParamHeaders = []; - $request->setKnowledgeBase($knowledgeBase); - $requestParamHeaders['knowledge_base.name'] = $knowledgeBase->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateKnowledgeBase', KnowledgeBase::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * $response = $knowledgeBasesClient->getLocation(); - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $knowledgeBasesClient = new KnowledgeBasesClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $knowledgeBasesClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $knowledgeBasesClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $knowledgeBasesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php deleted file mode 100644 index 53f5a849a6c0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php +++ /dev/null @@ -1,1726 +0,0 @@ -participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->analyzeContent($formattedParticipant); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\ParticipantsClient} to use the new surface. - */ -class ParticipantsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Participants'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $contextNameTemplate; - - private static $conversationNameTemplate; - - private static $messageNameTemplate; - - private static $participantNameTemplate; - - private static $projectConversationNameTemplate; - - private static $projectConversationMessageNameTemplate; - - private static $projectConversationParticipantNameTemplate; - - private static $projectEnvironmentUserSessionNameTemplate; - - private static $projectEnvironmentUserSessionContextNameTemplate; - - private static $projectEnvironmentUserSessionEntityTypeNameTemplate; - - private static $projectLocationConversationNameTemplate; - - private static $projectLocationConversationMessageNameTemplate; - - private static $projectLocationConversationParticipantNameTemplate; - - private static $projectLocationEnvironmentUserSessionNameTemplate; - - private static $projectLocationEnvironmentUserSessionContextNameTemplate; - - private static $projectLocationEnvironmentUserSessionEntityTypeNameTemplate; - - private static $projectLocationSessionNameTemplate; - - private static $projectLocationSessionContextNameTemplate; - - private static $projectLocationSessionEntityTypeNameTemplate; - - private static $projectSessionNameTemplate; - - private static $projectSessionContextNameTemplate; - - private static $projectSessionEntityTypeNameTemplate; - - private static $sessionNameTemplate; - - private static $sessionEntityTypeNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$contextNameTemplate; - } - - private static function getConversationNameTemplate() - { - if (self::$conversationNameTemplate == null) { - self::$conversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); - } - - return self::$conversationNameTemplate; - } - - private static function getMessageNameTemplate() - { - if (self::$messageNameTemplate == null) { - self::$messageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); - } - - return self::$messageNameTemplate; - } - - private static function getParticipantNameTemplate() - { - if (self::$participantNameTemplate == null) { - self::$participantNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/participants/{participant}'); - } - - return self::$participantNameTemplate; - } - - private static function getProjectConversationNameTemplate() - { - if (self::$projectConversationNameTemplate == null) { - self::$projectConversationNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}'); - } - - return self::$projectConversationNameTemplate; - } - - private static function getProjectConversationMessageNameTemplate() - { - if (self::$projectConversationMessageNameTemplate == null) { - self::$projectConversationMessageNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/messages/{message}'); - } - - return self::$projectConversationMessageNameTemplate; - } - - private static function getProjectConversationParticipantNameTemplate() - { - if (self::$projectConversationParticipantNameTemplate == null) { - self::$projectConversationParticipantNameTemplate = new PathTemplate('projects/{project}/conversations/{conversation}/participants/{participant}'); - } - - return self::$projectConversationParticipantNameTemplate; - } - - private static function getProjectEnvironmentUserSessionNameTemplate() - { - if (self::$projectEnvironmentUserSessionNameTemplate == null) { - self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectEnvironmentUserSessionNameTemplate; - } - - private static function getProjectEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { - self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectEnvironmentUserSessionEntityTypeNameTemplate() - { - if (self::$projectEnvironmentUserSessionEntityTypeNameTemplate == null) { - self::$projectEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectEnvironmentUserSessionEntityTypeNameTemplate; - } - - private static function getProjectLocationConversationNameTemplate() - { - if (self::$projectLocationConversationNameTemplate == null) { - self::$projectLocationConversationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}'); - } - - return self::$projectLocationConversationNameTemplate; - } - - private static function getProjectLocationConversationMessageNameTemplate() - { - if (self::$projectLocationConversationMessageNameTemplate == null) { - self::$projectLocationConversationMessageNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}'); - } - - return self::$projectLocationConversationMessageNameTemplate; - } - - private static function getProjectLocationConversationParticipantNameTemplate() - { - if (self::$projectLocationConversationParticipantNameTemplate == null) { - self::$projectLocationConversationParticipantNameTemplate = new PathTemplate('projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}'); - } - - return self::$projectLocationConversationParticipantNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectLocationEnvironmentUserSessionNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate; - } - - private static function getProjectLocationSessionNameTemplate() - { - if (self::$projectLocationSessionNameTemplate == null) { - self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); - } - - return self::$projectLocationSessionNameTemplate; - } - - private static function getProjectLocationSessionContextNameTemplate() - { - if (self::$projectLocationSessionContextNameTemplate == null) { - self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationSessionContextNameTemplate; - } - - private static function getProjectLocationSessionEntityTypeNameTemplate() - { - if (self::$projectLocationSessionEntityTypeNameTemplate == null) { - self::$projectLocationSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectLocationSessionEntityTypeNameTemplate; - } - - private static function getProjectSessionNameTemplate() - { - if (self::$projectSessionNameTemplate == null) { - self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$projectSessionNameTemplate; - } - - private static function getProjectSessionContextNameTemplate() - { - if (self::$projectSessionContextNameTemplate == null) { - self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectSessionContextNameTemplate; - } - - private static function getProjectSessionEntityTypeNameTemplate() - { - if (self::$projectSessionEntityTypeNameTemplate == null) { - self::$projectSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectSessionEntityTypeNameTemplate; - } - - private static function getSessionNameTemplate() - { - if (self::$sessionNameTemplate == null) { - self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$sessionNameTemplate; - } - - private static function getSessionEntityTypeNameTemplate() - { - if (self::$sessionEntityTypeNameTemplate == null) { - self::$sessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$sessionEntityTypeNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'context' => self::getContextNameTemplate(), - 'conversation' => self::getConversationNameTemplate(), - 'message' => self::getMessageNameTemplate(), - 'participant' => self::getParticipantNameTemplate(), - 'projectConversation' => self::getProjectConversationNameTemplate(), - 'projectConversationMessage' => self::getProjectConversationMessageNameTemplate(), - 'projectConversationParticipant' => self::getProjectConversationParticipantNameTemplate(), - 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), - 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), - 'projectEnvironmentUserSessionEntityType' => self::getProjectEnvironmentUserSessionEntityTypeNameTemplate(), - 'projectLocationConversation' => self::getProjectLocationConversationNameTemplate(), - 'projectLocationConversationMessage' => self::getProjectLocationConversationMessageNameTemplate(), - 'projectLocationConversationParticipant' => self::getProjectLocationConversationParticipantNameTemplate(), - 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), - 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), - 'projectLocationEnvironmentUserSessionEntityType' => self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate(), - 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), - 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), - 'projectLocationSessionEntityType' => self::getProjectLocationSessionEntityTypeNameTemplate(), - 'projectSession' => self::getProjectSessionNameTemplate(), - 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), - 'projectSessionEntityType' => self::getProjectSessionEntityTypeNameTemplate(), - 'session' => self::getSessionNameTemplate(), - 'sessionEntityType' => self::getSessionEntityTypeNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $session, $context) - { - return self::getContextNameTemplate()->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($project, $conversation) - { - return self::getConversationNameTemplate()->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($project, $conversation, $message) - { - return self::getMessageNameTemplate()->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($project, $conversation, $participant) - { - return self::getParticipantNameTemplate()->render([ - 'project' => $project, - 'conversation' => $conversation, - 'participant' => $participant, - ]); - } - - /** - * 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($project, $conversation) - { - return self::getProjectConversationNameTemplate()->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($project, $conversation, $message) - { - return self::getProjectConversationMessageNameTemplate()->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($project, $conversation, $participant) - { - return self::getProjectConversationParticipantNameTemplate()->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($project, $environment, $user, $session) - { - return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) - { - return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $environment, $user, $session, $entityType) - { - return self::getProjectEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $conversation) - { - return self::getProjectLocationConversationNameTemplate()->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($project, $location, $conversation, $message) - { - return self::getProjectLocationConversationMessageNameTemplate()->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($project, $location, $conversation, $participant) - { - return self::getProjectLocationConversationParticipantNameTemplate()->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($project, $location, $environment, $user, $session) - { - return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) - { - return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $environment, $user, $session, $entityType) - { - return self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $session) - { - return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) - { - return self::getProjectLocationSessionContextNameTemplate()->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($project, $location, $session, $entityType) - { - return self::getProjectLocationSessionEntityTypeNameTemplate()->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($project, $session) - { - return self::getProjectSessionNameTemplate()->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($project, $session, $context) - { - return self::getProjectSessionContextNameTemplate()->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($project, $session, $entityType) - { - return self::getProjectSessionEntityTypeNameTemplate()->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($project, $session) - { - return self::getSessionNameTemplate()->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($project, $session, $entityType) - { - return self::getSessionEntityTypeNameTemplate()->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} - * - 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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * 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). - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParticipant = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->analyzeContent($formattedParticipant); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $participant Required. The name of the participant this text comes from. - * Format: `projects//locations//conversations//participants/`. - * @param array $optionalArgs { - * Optional. - * - * @type TextInput $textInput - * The natural language text to be processed. - * @type EventInput $eventInput - * An input event to send to Dialogflow. - * @type OutputAudioConfig $replyAudioConfig - * 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 QueryParameters $queryParams - * Parameters for a Dialogflow virtual-agent query. - * @type AssistQueryParameters $assistQueryParams - * Parameters for a human assist query. - * @type Struct $cxParameters - * 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 $requestId - * 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. - * @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 \Google\Cloud\Dialogflow\V2\AnalyzeContentResponse - * - * @throws ApiException if the remote call fails - */ - public function analyzeContent($participant, array $optionalArgs = []) - { - $request = new AnalyzeContentRequest(); - $requestParamHeaders = []; - $request->setParticipant($participant); - $requestParamHeaders['participant'] = $participant; - if (isset($optionalArgs['textInput'])) { - $request->setTextInput($optionalArgs['textInput']); - } - - if (isset($optionalArgs['eventInput'])) { - $request->setEventInput($optionalArgs['eventInput']); - } - - if (isset($optionalArgs['replyAudioConfig'])) { - $request->setReplyAudioConfig($optionalArgs['replyAudioConfig']); - } - - if (isset($optionalArgs['queryParams'])) { - $request->setQueryParams($optionalArgs['queryParams']); - } - - if (isset($optionalArgs['assistQueryParams'])) { - $request->setAssistQueryParams($optionalArgs['assistQueryParams']); - } - - if (isset($optionalArgs['cxParameters'])) { - $request->setCxParameters($optionalArgs['cxParameters']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AnalyzeContent', AnalyzeContentResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new participant in a conversation. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParent = $participantsClient->conversationName('[PROJECT]', '[CONVERSATION]'); - * $participant = new Participant(); - * $response = $participantsClient->createParticipant($formattedParent, $participant); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource identifier of the conversation adding the participant. - * Format: `projects//locations//conversations/`. - * @param Participant $participant Required. The participant to create. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Participant - * - * @throws ApiException if the remote call fails - */ - public function createParticipant($parent, $participant, array $optionalArgs = []) - { - $request = new CreateParticipantRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setParticipant($participant); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateParticipant', Participant::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a conversation participant. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedName = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->getParticipant($formattedName); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the participant. Format: - * `projects//locations//conversations//participants/`. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Participant - * - * @throws ApiException if the remote call fails - */ - public function getParticipant($name, array $optionalArgs = []) - { - $request = new GetParticipantRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetParticipant', Participant::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all participants in the specified conversation. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParent = $participantsClient->conversationName('[PROJECT]', '[CONVERSATION]'); - * // Iterate over pages of elements - * $pagedResponse = $participantsClient->listParticipants($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $participantsClient->listParticipants($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $parent Required. The conversation to list all participants from. - * Format: `projects//locations//conversations/`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listParticipants($parent, array $optionalArgs = []) - { - $request = new ListParticipantsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListParticipants', $optionalArgs, ListParticipantsResponse::class, $request); - } - - /** - * 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). - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $participant = 'participant'; - * $request = new StreamingAnalyzeContentRequest(); - * $request->setParticipant($participant); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $participantsClient->streamingAnalyzeContent(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $participantsClient->streamingAnalyzeContent(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function streamingAnalyzeContent(array $optionalArgs = []) - { - return $this->startCall('StreamingAnalyzeContent', StreamingAnalyzeContentResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); - } - - /** - * Gets suggested articles for a participant based on specific historical - * messages. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->suggestArticles($formattedParent); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $latestMessage - * 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 $contextSize - * 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 AssistQueryParameters $assistQueryParams - * Parameters for a human assist query. - * @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 \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse - * - * @throws ApiException if the remote call fails - */ - public function suggestArticles($parent, array $optionalArgs = []) - { - $request = new SuggestArticlesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['latestMessage'])) { - $request->setLatestMessage($optionalArgs['latestMessage']); - } - - if (isset($optionalArgs['contextSize'])) { - $request->setContextSize($optionalArgs['contextSize']); - } - - if (isset($optionalArgs['assistQueryParams'])) { - $request->setAssistQueryParams($optionalArgs['assistQueryParams']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SuggestArticles', SuggestArticlesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets suggested faq answers for a participant based on specific historical - * messages. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->suggestFaqAnswers($formattedParent); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $latestMessage - * 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 $contextSize - * 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 AssistQueryParameters $assistQueryParams - * Parameters for a human assist query. - * @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 \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse - * - * @throws ApiException if the remote call fails - */ - public function suggestFaqAnswers($parent, array $optionalArgs = []) - { - $request = new SuggestFaqAnswersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['latestMessage'])) { - $request->setLatestMessage($optionalArgs['latestMessage']); - } - - if (isset($optionalArgs['contextSize'])) { - $request->setContextSize($optionalArgs['contextSize']); - } - - if (isset($optionalArgs['assistQueryParams'])) { - $request->setAssistQueryParams($optionalArgs['assistQueryParams']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SuggestFaqAnswers', SuggestFaqAnswersResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets smart replies for a participant based on specific historical - * messages. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->suggestSmartReplies($formattedParent); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param array $optionalArgs { - * Optional. - * - * @type TextInput $currentTextInput - * 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 $latestMessage - * 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 $contextSize - * 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 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 \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse - * - * @throws ApiException if the remote call fails - */ - public function suggestSmartReplies($parent, array $optionalArgs = []) - { - $request = new SuggestSmartRepliesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['currentTextInput'])) { - $request->setCurrentTextInput($optionalArgs['currentTextInput']); - } - - if (isset($optionalArgs['latestMessage'])) { - $request->setLatestMessage($optionalArgs['latestMessage']); - } - - if (isset($optionalArgs['contextSize'])) { - $request->setContextSize($optionalArgs['contextSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SuggestSmartReplies', SuggestSmartRepliesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates the specified participant. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $participant = new Participant(); - * $updateMask = new FieldMask(); - * $response = $participantsClient->updateParticipant($participant, $updateMask); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param Participant $participant Required. The participant to update. - * @param FieldMask $updateMask Required. The mask to specify which fields to update. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Participant - * - * @throws ApiException if the remote call fails - */ - public function updateParticipant($participant, $updateMask, array $optionalArgs = []) - { - $request = new UpdateParticipantRequest(); - $requestParamHeaders = []; - $request->setParticipant($participant); - $request->setUpdateMask($updateMask); - $requestParamHeaders['participant.name'] = $participant->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateParticipant', Participant::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $response = $participantsClient->getLocation(); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $participantsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $participantsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php deleted file mode 100644 index 71861d909604..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php +++ /dev/null @@ -1,959 +0,0 @@ -sessionName('[PROJECT]', '[SESSION]'); - * $sessionEntityType = new SessionEntityType(); - * $response = $sessionEntityTypesClient->createSessionEntityType($formattedParent, $sessionEntityType); - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\SessionEntityTypesClient} to use the new - * surface. - */ -class SessionEntityTypesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $projectEnvironmentUserSessionNameTemplate; - - private static $projectEnvironmentUserSessionEntityTypeNameTemplate; - - private static $projectLocationEnvironmentUserSessionNameTemplate; - - private static $projectLocationEnvironmentUserSessionEntityTypeNameTemplate; - - private static $projectLocationSessionNameTemplate; - - private static $projectLocationSessionEntityTypeNameTemplate; - - private static $projectSessionNameTemplate; - - private static $projectSessionEntityTypeNameTemplate; - - private static $sessionNameTemplate; - - private static $sessionEntityTypeNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getProjectEnvironmentUserSessionNameTemplate() - { - if (self::$projectEnvironmentUserSessionNameTemplate == null) { - self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectEnvironmentUserSessionNameTemplate; - } - - private static function getProjectEnvironmentUserSessionEntityTypeNameTemplate() - { - if (self::$projectEnvironmentUserSessionEntityTypeNameTemplate == null) { - self::$projectEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectEnvironmentUserSessionEntityTypeNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectLocationEnvironmentUserSessionNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate; - } - - private static function getProjectLocationSessionNameTemplate() - { - if (self::$projectLocationSessionNameTemplate == null) { - self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); - } - - return self::$projectLocationSessionNameTemplate; - } - - private static function getProjectLocationSessionEntityTypeNameTemplate() - { - if (self::$projectLocationSessionEntityTypeNameTemplate == null) { - self::$projectLocationSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectLocationSessionEntityTypeNameTemplate; - } - - private static function getProjectSessionNameTemplate() - { - if (self::$projectSessionNameTemplate == null) { - self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$projectSessionNameTemplate; - } - - private static function getProjectSessionEntityTypeNameTemplate() - { - if (self::$projectSessionEntityTypeNameTemplate == null) { - self::$projectSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectSessionEntityTypeNameTemplate; - } - - private static function getSessionNameTemplate() - { - if (self::$sessionNameTemplate == null) { - self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$sessionNameTemplate; - } - - private static function getSessionEntityTypeNameTemplate() - { - if (self::$sessionEntityTypeNameTemplate == null) { - self::$sessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$sessionEntityTypeNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), - 'projectEnvironmentUserSessionEntityType' => self::getProjectEnvironmentUserSessionEntityTypeNameTemplate(), - 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), - 'projectLocationEnvironmentUserSessionEntityType' => self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate(), - 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), - 'projectLocationSessionEntityType' => self::getProjectLocationSessionEntityTypeNameTemplate(), - 'projectSession' => self::getProjectSessionNameTemplate(), - 'projectSessionEntityType' => self::getProjectSessionEntityTypeNameTemplate(), - 'session' => self::getSessionNameTemplate(), - 'sessionEntityType' => self::getSessionEntityTypeNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $environment, $user, $session) - { - return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $entityType) - { - return self::getProjectEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $environment, $user, $session) - { - return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $entityType) - { - return self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $session) - { - return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $entityType) - { - return self::getProjectLocationSessionEntityTypeNameTemplate()->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($project, $session) - { - return self::getProjectSessionNameTemplate()->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($project, $session, $entityType) - { - return self::getProjectSessionEntityTypeNameTemplate()->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($project, $session) - { - return self::getSessionNameTemplate()->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($project, $session, $entityType) - { - return self::getSessionEntityTypeNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * 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. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * $formattedParent = $sessionEntityTypesClient->sessionName('[PROJECT]', '[SESSION]'); - * $sessionEntityType = new SessionEntityType(); - * $response = $sessionEntityTypesClient->createSessionEntityType($formattedParent, $sessionEntityType); - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @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. - * @param SessionEntityType $sessionEntityType Required. The session entity type to create. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\SessionEntityType - * - * @throws ApiException if the remote call fails - */ - public function createSessionEntityType($parent, $sessionEntityType, array $optionalArgs = []) - { - $request = new CreateSessionEntityTypeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSessionEntityType($sessionEntityType); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateSessionEntityType', SessionEntityType::class, $optionalArgs, $request)->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. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * $formattedName = $sessionEntityTypesClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); - * $sessionEntityTypesClient->deleteSessionEntityType($formattedName); - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteSessionEntityType($name, array $optionalArgs = []) - { - $request = new DeleteSessionEntityTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteSessionEntityType', GPBEmpty::class, $optionalArgs, $request)->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. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * $formattedName = $sessionEntityTypesClient->sessionEntityTypeName('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]'); - * $response = $sessionEntityTypesClient->getSessionEntityType($formattedName); - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\SessionEntityType - * - * @throws ApiException if the remote call fails - */ - public function getSessionEntityType($name, array $optionalArgs = []) - { - $request = new GetSessionEntityTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetSessionEntityType', SessionEntityType::class, $optionalArgs, $request)->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. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * $formattedParent = $sessionEntityTypesClient->sessionName('[PROJECT]', '[SESSION]'); - * // Iterate over pages of elements - * $pagedResponse = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @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. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSessionEntityTypes($parent, array $optionalArgs = []) - { - $request = new ListSessionEntityTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListSessionEntityTypes', $optionalArgs, ListSessionEntityTypesResponse::class, $request); - } - - /** - * 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. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * $sessionEntityType = new SessionEntityType(); - * $response = $sessionEntityTypesClient->updateSessionEntityType($sessionEntityType); - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @param SessionEntityType $sessionEntityType Required. The session entity type to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The mask to control which fields get updated. - * @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 \Google\Cloud\Dialogflow\V2\SessionEntityType - * - * @throws ApiException if the remote call fails - */ - public function updateSessionEntityType($sessionEntityType, array $optionalArgs = []) - { - $request = new UpdateSessionEntityTypeRequest(); - $requestParamHeaders = []; - $request->setSessionEntityType($sessionEntityType); - $requestParamHeaders['session_entity_type.name'] = $sessionEntityType->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateSessionEntityType', SessionEntityType::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * $response = $sessionEntityTypesClient->getLocation(); - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $sessionEntityTypesClient = new SessionEntityTypesClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $sessionEntityTypesClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $sessionEntityTypesClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $sessionEntityTypesClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php deleted file mode 100644 index a511bb40a939..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php +++ /dev/null @@ -1,1045 +0,0 @@ -sessionName('[PROJECT]', '[SESSION]'); - * $queryInput = new QueryInput(); - * $response = $sessionsClient->detectIntent($formattedSession, $queryInput); - * } finally { - * $sessionsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\SessionsClient} to use the new surface. - */ -class SessionsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Sessions'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $contextNameTemplate; - - private static $projectEnvironmentUserSessionNameTemplate; - - private static $projectEnvironmentUserSessionContextNameTemplate; - - private static $projectEnvironmentUserSessionEntityTypeNameTemplate; - - private static $projectLocationEnvironmentUserSessionNameTemplate; - - private static $projectLocationEnvironmentUserSessionContextNameTemplate; - - private static $projectLocationEnvironmentUserSessionEntityTypeNameTemplate; - - private static $projectLocationSessionNameTemplate; - - private static $projectLocationSessionContextNameTemplate; - - private static $projectLocationSessionEntityTypeNameTemplate; - - private static $projectSessionNameTemplate; - - private static $projectSessionContextNameTemplate; - - private static $projectSessionEntityTypeNameTemplate; - - private static $sessionNameTemplate; - - private static $sessionEntityTypeNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getContextNameTemplate() - { - if (self::$contextNameTemplate == null) { - self::$contextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$contextNameTemplate; - } - - private static function getProjectEnvironmentUserSessionNameTemplate() - { - if (self::$projectEnvironmentUserSessionNameTemplate == null) { - self::$projectEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectEnvironmentUserSessionNameTemplate; - } - - private static function getProjectEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectEnvironmentUserSessionContextNameTemplate == null) { - self::$projectEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectEnvironmentUserSessionEntityTypeNameTemplate() - { - if (self::$projectEnvironmentUserSessionEntityTypeNameTemplate == null) { - self::$projectEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectEnvironmentUserSessionEntityTypeNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}'); - } - - return self::$projectLocationEnvironmentUserSessionNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionContextNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionContextNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationEnvironmentUserSessionContextNameTemplate; - } - - private static function getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate() - { - if (self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate == null) { - self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectLocationEnvironmentUserSessionEntityTypeNameTemplate; - } - - private static function getProjectLocationSessionNameTemplate() - { - if (self::$projectLocationSessionNameTemplate == null) { - self::$projectLocationSessionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}'); - } - - return self::$projectLocationSessionNameTemplate; - } - - private static function getProjectLocationSessionContextNameTemplate() - { - if (self::$projectLocationSessionContextNameTemplate == null) { - self::$projectLocationSessionContextNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectLocationSessionContextNameTemplate; - } - - private static function getProjectLocationSessionEntityTypeNameTemplate() - { - if (self::$projectLocationSessionEntityTypeNameTemplate == null) { - self::$projectLocationSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectLocationSessionEntityTypeNameTemplate; - } - - private static function getProjectSessionNameTemplate() - { - if (self::$projectSessionNameTemplate == null) { - self::$projectSessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$projectSessionNameTemplate; - } - - private static function getProjectSessionContextNameTemplate() - { - if (self::$projectSessionContextNameTemplate == null) { - self::$projectSessionContextNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/contexts/{context}'); - } - - return self::$projectSessionContextNameTemplate; - } - - private static function getProjectSessionEntityTypeNameTemplate() - { - if (self::$projectSessionEntityTypeNameTemplate == null) { - self::$projectSessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$projectSessionEntityTypeNameTemplate; - } - - private static function getSessionNameTemplate() - { - if (self::$sessionNameTemplate == null) { - self::$sessionNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}'); - } - - return self::$sessionNameTemplate; - } - - private static function getSessionEntityTypeNameTemplate() - { - if (self::$sessionEntityTypeNameTemplate == null) { - self::$sessionEntityTypeNameTemplate = new PathTemplate('projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}'); - } - - return self::$sessionEntityTypeNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'context' => self::getContextNameTemplate(), - 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), - 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), - 'projectEnvironmentUserSessionEntityType' => self::getProjectEnvironmentUserSessionEntityTypeNameTemplate(), - 'projectLocationEnvironmentUserSession' => self::getProjectLocationEnvironmentUserSessionNameTemplate(), - 'projectLocationEnvironmentUserSessionContext' => self::getProjectLocationEnvironmentUserSessionContextNameTemplate(), - 'projectLocationEnvironmentUserSessionEntityType' => self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate(), - 'projectLocationSession' => self::getProjectLocationSessionNameTemplate(), - 'projectLocationSessionContext' => self::getProjectLocationSessionContextNameTemplate(), - 'projectLocationSessionEntityType' => self::getProjectLocationSessionEntityTypeNameTemplate(), - 'projectSession' => self::getProjectSessionNameTemplate(), - 'projectSessionContext' => self::getProjectSessionContextNameTemplate(), - 'projectSessionEntityType' => self::getProjectSessionEntityTypeNameTemplate(), - 'session' => self::getSessionNameTemplate(), - 'sessionEntityType' => self::getSessionEntityTypeNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $session, $context) - { - return self::getContextNameTemplate()->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($project, $environment, $user, $session) - { - return self::getProjectEnvironmentUserSessionNameTemplate()->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($project, $environment, $user, $session, $context) - { - return self::getProjectEnvironmentUserSessionContextNameTemplate()->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($project, $environment, $user, $session, $entityType) - { - return self::getProjectEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $environment, $user, $session) - { - return self::getProjectLocationEnvironmentUserSessionNameTemplate()->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($project, $location, $environment, $user, $session, $context) - { - return self::getProjectLocationEnvironmentUserSessionContextNameTemplate()->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($project, $location, $environment, $user, $session, $entityType) - { - return self::getProjectLocationEnvironmentUserSessionEntityTypeNameTemplate()->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($project, $location, $session) - { - return self::getProjectLocationSessionNameTemplate()->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($project, $location, $session, $context) - { - return self::getProjectLocationSessionContextNameTemplate()->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($project, $location, $session, $entityType) - { - return self::getProjectLocationSessionEntityTypeNameTemplate()->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($project, $session) - { - return self::getProjectSessionNameTemplate()->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($project, $session, $context) - { - return self::getProjectSessionContextNameTemplate()->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($project, $session, $entityType) - { - return self::getProjectSessionEntityTypeNameTemplate()->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($project, $session) - { - return self::getSessionNameTemplate()->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($project, $session, $entityType) - { - return self::getSessionEntityTypeNameTemplate()->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} - * - 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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * 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). - * - * Sample code: - * ``` - * $sessionsClient = new SessionsClient(); - * try { - * $formattedSession = $sessionsClient->sessionName('[PROJECT]', '[SESSION]'); - * $queryInput = new QueryInput(); - * $response = $sessionsClient->detectIntent($formattedSession, $queryInput); - * } finally { - * $sessionsClient->close(); - * } - * ``` - * - * @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). - * @param 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. - * @param array $optionalArgs { - * Optional. - * - * @type QueryParameters $queryParams - * The parameters of this query. - * @type OutputAudioConfig $outputAudioConfig - * 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 FieldMask $outputAudioConfigMask - * 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 $inputAudio - * 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. - * @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 \Google\Cloud\Dialogflow\V2\DetectIntentResponse - * - * @throws ApiException if the remote call fails - */ - public function detectIntent($session, $queryInput, array $optionalArgs = []) - { - $request = new DetectIntentRequest(); - $requestParamHeaders = []; - $request->setSession($session); - $request->setQueryInput($queryInput); - $requestParamHeaders['session'] = $session; - if (isset($optionalArgs['queryParams'])) { - $request->setQueryParams($optionalArgs['queryParams']); - } - - if (isset($optionalArgs['outputAudioConfig'])) { - $request->setOutputAudioConfig($optionalArgs['outputAudioConfig']); - } - - if (isset($optionalArgs['outputAudioConfigMask'])) { - $request->setOutputAudioConfigMask($optionalArgs['outputAudioConfigMask']); - } - - if (isset($optionalArgs['inputAudio'])) { - $request->setInputAudio($optionalArgs['inputAudio']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DetectIntent', DetectIntentResponse::class, $optionalArgs, $request)->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). - * - * Sample code: - * ``` - * $sessionsClient = new SessionsClient(); - * try { - * $session = 'session'; - * $queryInput = new QueryInput(); - * $request = new StreamingDetectIntentRequest(); - * $request->setSession($session); - * $request->setQueryInput($queryInput); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $sessionsClient->streamingDetectIntent(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $sessionsClient->streamingDetectIntent(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $sessionsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function streamingDetectIntent(array $optionalArgs = []) - { - return $this->startCall('StreamingDetectIntent', StreamingDetectIntentResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $sessionsClient = new SessionsClient(); - * try { - * $response = $sessionsClient->getLocation(); - * } finally { - * $sessionsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $sessionsClient = new SessionsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $sessionsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $sessionsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $sessionsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php deleted file mode 100644 index 3917117fc43a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php +++ /dev/null @@ -1,782 +0,0 @@ -agentName('[PROJECT]'); - * $version = new Version(); - * $response = $versionsClient->createVersion($formattedParent, $version); - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Dialogflow\V2\Client\VersionsClient} to use the new surface. - */ -class VersionsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Versions'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - 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 $agentNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationVersionNameTemplate; - - private static $projectVersionNameTemplate; - - private static $versionNameTemplate; - - private static $pathTemplateMap; - - 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', - ], - ], - ]; - } - - private static function getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getProjectAgentNameTemplate() - { - if (self::$projectAgentNameTemplate == null) { - self::$projectAgentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$projectAgentNameTemplate; - } - - private static function getProjectLocationAgentNameTemplate() - { - if (self::$projectLocationAgentNameTemplate == null) { - self::$projectLocationAgentNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent'); - } - - return self::$projectLocationAgentNameTemplate; - } - - private static function getProjectLocationVersionNameTemplate() - { - if (self::$projectLocationVersionNameTemplate == null) { - self::$projectLocationVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/agent/versions/{version}'); - } - - return self::$projectLocationVersionNameTemplate; - } - - private static function getProjectVersionNameTemplate() - { - if (self::$projectVersionNameTemplate == null) { - self::$projectVersionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); - } - - return self::$projectVersionNameTemplate; - } - - private static function getVersionNameTemplate() - { - if (self::$versionNameTemplate == null) { - self::$versionNameTemplate = new PathTemplate('projects/{project}/agent/versions/{version}'); - } - - return self::$versionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'agent' => self::getAgentNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationVersion' => self::getProjectLocationVersionNameTemplate(), - 'projectVersion' => self::getProjectVersionNameTemplate(), - 'version' => self::getVersionNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project) - { - return self::getAgentNameTemplate()->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($project) - { - return self::getProjectAgentNameTemplate()->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($project, $location) - { - return self::getProjectLocationAgentNameTemplate()->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($project, $location, $version) - { - return self::getProjectLocationVersionNameTemplate()->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($project, $version) - { - return self::getProjectVersionNameTemplate()->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($project, $version) - { - return self::getVersionNameTemplate()->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($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $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 string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @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. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates an agent version. - * - * The new version points to the agent instance in the "default" environment. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * $formattedParent = $versionsClient->agentName('[PROJECT]'); - * $version = new Version(); - * $response = $versionsClient->createVersion($formattedParent, $version); - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to create a version for. - * Supported formats: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param Version $version Required. The version to create. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Version - * - * @throws ApiException if the remote call fails - */ - public function createVersion($parent, $version, array $optionalArgs = []) - { - $request = new CreateVersionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setVersion($version); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateVersion', Version::class, $optionalArgs, $request)->wait(); - } - - /** - * Delete the specified agent version. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * $formattedName = $versionsClient->versionName('[PROJECT]', '[VERSION]'); - * $versionsClient->deleteVersion($formattedName); - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the version to delete. - * Supported formats: - * - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param array $optionalArgs { - * 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 if the remote call fails - */ - public function deleteVersion($name, array $optionalArgs = []) - { - $request = new DeleteVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteVersion', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the specified agent version. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * $formattedName = $versionsClient->versionName('[PROJECT]', '[VERSION]'); - * $response = $versionsClient->getVersion($formattedName); - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the version. - * Supported formats: - * - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Version - * - * @throws ApiException if the remote call fails - */ - public function getVersion($name, array $optionalArgs = []) - { - $request = new GetVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetVersion', Version::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the list of all versions of the specified agent. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * $formattedParent = $versionsClient->agentName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $versionsClient->listVersions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $versionsClient->listVersions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param string $parent Required. The agent to list all versions from. - * Supported formats: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listVersions($parent, array $optionalArgs = []) - { - $request = new ListVersionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListVersions', $optionalArgs, ListVersionsResponse::class, $request); - } - - /** - * 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. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * $version = new Version(); - * $updateMask = new FieldMask(); - * $response = $versionsClient->updateVersion($version, $updateMask); - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param Version $version Required. The version to update. - * Supported formats: - * - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param FieldMask $updateMask Required. The mask to control which fields get updated. - * @param array $optionalArgs { - * 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 \Google\Cloud\Dialogflow\V2\Version - * - * @throws ApiException if the remote call fails - */ - public function updateVersion($version, $updateMask, array $optionalArgs = []) - { - $request = new UpdateVersionRequest(); - $requestParamHeaders = []; - $request->setVersion($version); - $request->setUpdateMask($updateMask); - $requestParamHeaders['version.name'] = $version->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateVersion', Version::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * $response = $versionsClient->getLocation(); - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @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 \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $versionsClient = new VersionsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $versionsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $versionsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $versionsClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php deleted file mode 100644 index 028165b14025..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/IntentsClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - '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 deleted file mode 100644 index 1212b8a0f942..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php +++ /dev/null @@ -1,250 +0,0 @@ - [ - '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 deleted file mode 100644 index 2114a79c3ccc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "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 deleted file mode 100644 index 62e4f6c73fdd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php +++ /dev/null @@ -1,82 +0,0 @@ - [ - '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' => [ - 'answerRecord' => 'projects/{project}/answerRecords/{answer_record}', - 'location' => 'projects/{project}/locations/{location}', - 'project' => 'projects/{project}', - 'projectAnswerRecord' => 'projects/{project}/answerRecords/{answer_record}', - 'projectLocationAnswerRecord' => 'projects/{project}/locations/{location}/answerRecords/{answer_record}', - ], - ], - ], -]; 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 deleted file mode 100644 index be58c5eb38bf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php +++ /dev/null @@ -1,129 +0,0 @@ - [ - '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 deleted file mode 100644 index 405824724392..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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 deleted file mode 100644 index e66161c355f7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php +++ /dev/null @@ -1,135 +0,0 @@ - [ - '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 deleted file mode 100644 index 5aa624661cfd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php +++ /dev/null @@ -1,245 +0,0 @@ - [ - '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 deleted file mode 100644 index bbee4eabff14..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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 deleted file mode 100644 index ee1643d94e3f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php +++ /dev/null @@ -1,135 +0,0 @@ - [ - '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 deleted file mode 100644 index 762313f329f2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php +++ /dev/null @@ -1,162 +0,0 @@ - [ - '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 deleted file mode 100644 index ecdf8c5a3de4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "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 deleted file mode 100644 index b783cf57c9e6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php +++ /dev/null @@ -1,213 +0,0 @@ - [ - '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 deleted file mode 100644 index 88d3051f1cbc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php +++ /dev/null @@ -1,240 +0,0 @@ - [ - '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 deleted file mode 100644 index 2898ad3018aa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "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 deleted file mode 100644 index 9b6a76ea2095..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php +++ /dev/null @@ -1,169 +0,0 @@ - [ - '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}', - 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', - 'location' => 'projects/{project}/locations/{location}', - '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 deleted file mode 100644 index 332fc52eec04..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php +++ /dev/null @@ -1,220 +0,0 @@ - [ - '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 deleted file mode 100644 index 4b4cc56a8955..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "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" - }, - "GenerateStatelessSummary": { - "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" - }, - "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" - }, - "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 deleted file mode 100644 index b9fd2614efc4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php +++ /dev/null @@ -1,169 +0,0 @@ - [ - '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', - ], - ], - ], - ], - 'GenerateStatelessSummary' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse', - 'headerParams' => [ - [ - 'keyName' => 'stateless_conversation.parent', - 'fieldAccessors' => [ - 'getStatelessConversation', - 'getParent', - ], - ], - ], - ], - 'GetConversation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - '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', - '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}', - 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', - 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', - 'location' => 'projects/{project}/locations/{location}', - 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', - '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', - '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}', - '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/conversations_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php deleted file mode 100644 index e2874160aaec..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php +++ /dev/null @@ -1,214 +0,0 @@ - [ - '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', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'GetConversation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/conversations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - '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 deleted file mode 100644 index aaddca9c9fcc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "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 deleted file mode 100644 index 93f28e5e2941..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php +++ /dev/null @@ -1,197 +0,0 @@ - [ - '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 deleted file mode 100644 index f8d1387de2f2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php +++ /dev/null @@ -1,260 +0,0 @@ - [ - '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/entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json deleted file mode 100644 index 0380bfe8f674..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "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 deleted file mode 100644 index 75818f2640bd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php +++ /dev/null @@ -1,214 +0,0 @@ - [ - '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 deleted file mode 100644 index 76dd3e467342..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php +++ /dev/null @@ -1,271 +0,0 @@ - [ - '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 deleted file mode 100644 index 00d6f74b6016..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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 deleted file mode 100644 index 5fc9e95edee2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php +++ /dev/null @@ -1,145 +0,0 @@ - [ - '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 deleted file mode 100644 index 5953798d6344..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php +++ /dev/null @@ -1,205 +0,0 @@ - [ - '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 deleted file mode 100644 index 8e6cc14bb9c3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "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 deleted file mode 100644 index 093e1dd5bc8f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php +++ /dev/null @@ -1,72 +0,0 @@ - [ - '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 deleted file mode 100644 index 272e028f1c81..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php +++ /dev/null @@ -1,129 +0,0 @@ - [ - '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/intents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json deleted file mode 100644 index f6d3f00e1293..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "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 deleted file mode 100644 index 9d492795e280..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php +++ /dev/null @@ -1,167 +0,0 @@ - [ - '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 deleted file mode 100644 index 6c5df8324599..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php +++ /dev/null @@ -1,222 +0,0 @@ - [ - '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 deleted file mode 100644 index 8b18c4c682f0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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 deleted file mode 100644 index ce33699d01b7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php +++ /dev/null @@ -1,118 +0,0 @@ - [ - '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 deleted file mode 100644 index c801f5cd5963..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php +++ /dev/null @@ -1,198 +0,0 @@ - [ - '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 deleted file mode 100644 index 7d7ae17012ef..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "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": [] - }, - "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": { - "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" - }, - "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 deleted file mode 100644 index bedebe92aa35..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php +++ /dev/null @@ -1,180 +0,0 @@ - [ - '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', - ], - ], - ], - ], - '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}', - '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 deleted file mode 100644 index 29293e1cf8ba..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php +++ /dev/null @@ -1,241 +0,0 @@ - [ - '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', - ], - ], - ], - ], - '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 deleted file mode 100644 index 521ba47be243..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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 deleted file mode 100644 index f0908f053be9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php +++ /dev/null @@ -1,123 +0,0 @@ - [ - '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 deleted file mode 100644 index b2cf293b33a8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php +++ /dev/null @@ -1,220 +0,0 @@ - [ - '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 deleted file mode 100644 index 4967706e6ba8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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 deleted file mode 100644 index 0b18316632c7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - '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}', - '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 deleted file mode 100644 index b7cba0ec4c2e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php +++ /dev/null @@ -1,115 +0,0 @@ - [ - '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/versions_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json deleted file mode 100644 index e4e6368ea17f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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 deleted file mode 100644 index 06f584f447f3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php +++ /dev/null @@ -1,119 +0,0 @@ - [ - '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 deleted file mode 100644 index 0fce60904b1d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php +++ /dev/null @@ -1,182 +0,0 @@ - [ - '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/AgentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php deleted file mode 100644 index 0115e3da93be..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php +++ /dev/null @@ -1,1012 +0,0 @@ -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]'); - $gapicClient->deleteAgent($formattedParent); - $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]'); - try { - $gapicClient->deleteAgent($formattedParent); - // 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'; - $response = $gapicClient->exportAgent($formattedParent, $agentUri); - $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'; - $response = $gapicClient->exportAgent($formattedParent, $agentUri); - $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]'); - $response = $gapicClient->getAgent($formattedParent); - $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]'); - try { - $gapicClient->getAgent($formattedParent); - // 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]'); - $response = $gapicClient->getValidationResult($formattedParent); - $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]'); - try { - $gapicClient->getValidationResult($formattedParent); - // 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]'); - $response = $gapicClient->importAgent($formattedParent); - $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]'); - $response = $gapicClient->importAgent($formattedParent); - $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]'); - $response = $gapicClient->restoreAgent($formattedParent); - $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]'); - $response = $gapicClient->restoreAgent($formattedParent); - $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]'); - $response = $gapicClient->searchAgents($formattedParent); - $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]'); - try { - $gapicClient->searchAgents($formattedParent); - // 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); - $response = $gapicClient->setAgent($agent); - $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); - try { - $gapicClient->setAgent($agent); - // 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]'); - $response = $gapicClient->trainAgent($formattedParent); - $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]'); - $response = $gapicClient->trainAgent($formattedParent); - $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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php deleted file mode 100644 index 804d1c0c9e59..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AnswerRecordsClientTest.php +++ /dev/null @@ -1,322 +0,0 @@ -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]'); - $response = $gapicClient->listAnswerRecords($formattedParent); - $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]'); - try { - $gapicClient->listAnswerRecords($formattedParent); - // 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(); - $response = $gapicClient->updateAnswerRecord($answerRecord, $updateMask); - $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(); - try { - $gapicClient->updateAnswerRecord($answerRecord, $updateMask); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} 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 deleted file mode 100644 index 6e39018bac30..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AgentsClientTest.php +++ /dev/null @@ -1,1091 +0,0 @@ -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 deleted file mode 100644 index aafd68dab8a6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/AnswerRecordsClientTest.php +++ /dev/null @@ -1,377 +0,0 @@ -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 deleted file mode 100644 index ca02b76bd31a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ContextsClientTest.php +++ /dev/null @@ -1,640 +0,0 @@ -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 deleted file mode 100644 index 29e8ce86a2ce..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php +++ /dev/null @@ -1,813 +0,0 @@ -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; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $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; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $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; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $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 deleted file mode 100644 index 110d2a19e70e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php +++ /dev/null @@ -1,1191 +0,0 @@ -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'; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $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'; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $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'; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $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 deleted file mode 100644 index 3d5e4fe40bdf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php +++ /dev/null @@ -1,943 +0,0 @@ -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 deleted file mode 100644 index 0bd5f13f76a6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php +++ /dev/null @@ -1,736 +0,0 @@ -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 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 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 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 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 deleted file mode 100644 index b1159a063774..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php +++ /dev/null @@ -1,1243 +0,0 @@ -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/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php deleted file mode 100644 index 71c17e49323a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php +++ /dev/null @@ -1,1263 +0,0 @@ -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 deleted file mode 100644 index e942e4407219..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php +++ /dev/null @@ -1,670 +0,0 @@ -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 deleted file mode 100644 index a350fb74fbd1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php +++ /dev/null @@ -1,371 +0,0 @@ -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/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php deleted file mode 100644 index aa572dd48cd3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php +++ /dev/null @@ -1,918 +0,0 @@ -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 deleted file mode 100644 index 4bf41226d3f7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php +++ /dev/null @@ -1,586 +0,0 @@ -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 deleted file mode 100644 index a7250c8bd6f9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php +++ /dev/null @@ -1,885 +0,0 @@ -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'; - $expectedResponse = new StreamingAnalyzeContentResponse(); - $expectedResponse->setReplyText($replyText); - $transport->addResponse($expectedResponse); - $replyText2 = 'replyText2518940821'; - $expectedResponse2 = new StreamingAnalyzeContentResponse(); - $expectedResponse2->setReplyText($replyText2); - $transport->addResponse($expectedResponse2); - $replyText3 = 'replyText3518940822'; - $expectedResponse3 = new StreamingAnalyzeContentResponse(); - $expectedResponse3->setReplyText($replyText3); - $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 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 deleted file mode 100644 index b2f6032cde96..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php +++ /dev/null @@ -1,591 +0,0 @@ -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 deleted file mode 100644 index 4848f48cb393..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php +++ /dev/null @@ -1,413 +0,0 @@ -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/VersionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php deleted file mode 100644 index a5b6e3c80f4b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/VersionsClientTest.php +++ /dev/null @@ -1,583 +0,0 @@ -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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php deleted file mode 100644 index e6d0c6a53c64..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ContextsClientTest.php +++ /dev/null @@ -1,565 +0,0 @@ -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); - $response = $gapicClient->createContext($formattedParent, $context); - $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); - try { - $gapicClient->createContext($formattedParent, $context); - // 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]'); - $gapicClient->deleteAllContexts($formattedParent); - $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]'); - try { - $gapicClient->deleteAllContexts($formattedParent); - // 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]'); - $gapicClient->deleteContext($formattedName); - $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]'); - try { - $gapicClient->deleteContext($formattedName); - // 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]'); - $response = $gapicClient->getContext($formattedName); - $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]'); - try { - $gapicClient->getContext($formattedName); - // 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]'); - $response = $gapicClient->listContexts($formattedParent); - $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]'); - try { - $gapicClient->listContexts($formattedParent); - // 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); - $response = $gapicClient->updateContext($context); - $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); - try { - $gapicClient->updateContext($context); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php deleted file mode 100644 index c89e0f1221f4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php +++ /dev/null @@ -1,700 +0,0 @@ -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; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $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); - $response = $gapicClient->createConversationDataset($parent, $conversationDataset); - $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); - $response = $gapicClient->createConversationDataset($parent, $conversationDataset); - $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]'); - $response = $gapicClient->deleteConversationDataset($formattedName); - $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]'); - $response = $gapicClient->deleteConversationDataset($formattedName); - $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; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $response = $gapicClient->getConversationDataset($formattedName); - $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]'); - try { - $gapicClient->getConversationDataset($formattedName); - // 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(); - $response = $gapicClient->importConversationData($formattedName, $inputConfig); - $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(); - $response = $gapicClient->importConversationData($formattedName, $inputConfig); - $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]'); - $response = $gapicClient->listConversationDatasets($formattedParent); - $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]'); - try { - $gapicClient->listConversationDatasets($formattedParent); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php deleted file mode 100644 index bd9cb022b550..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php +++ /dev/null @@ -1,1064 +0,0 @@ -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'; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $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); - $response = $gapicClient->createConversationModel($conversationModel); - $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); - $response = $gapicClient->createConversationModel($conversationModel); - $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(); - $response = $gapicClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); - $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(); - $response = $gapicClient->createConversationModelEvaluation($formattedParent, $conversationModelEvaluation); - $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'; - $response = $gapicClient->deleteConversationModel($name); - $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'; - $response = $gapicClient->deleteConversationModel($name); - $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'; - $response = $gapicClient->deployConversationModel($name); - $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'; - $response = $gapicClient->deployConversationModel($name); - $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'; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->getConversationModel($name); - $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'; - try { - $gapicClient->getConversationModel($name); - // 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'; - $response = $gapicClient->getConversationModelEvaluation($name); - $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'; - try { - $gapicClient->getConversationModelEvaluation($name); - // 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'; - $response = $gapicClient->listConversationModelEvaluations($parent); - $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'; - try { - $gapicClient->listConversationModelEvaluations($parent); - // 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'; - $response = $gapicClient->listConversationModels($parent); - $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'; - try { - $gapicClient->listConversationModels($parent); - // 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'; - $response = $gapicClient->undeployConversationModel($name); - $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'; - $response = $gapicClient->undeployConversationModel($name); - $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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php deleted file mode 100644 index dd4e641e4a34..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationProfilesClientTest.php +++ /dev/null @@ -1,808 +0,0 @@ -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; - $response = $gapicClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); - $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; - $response = $gapicClient->clearSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureType); - $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); - $response = $gapicClient->createConversationProfile($formattedParent, $conversationProfile); - $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); - try { - $gapicClient->createConversationProfile($formattedParent, $conversationProfile); - // 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]'); - $gapicClient->deleteConversationProfile($formattedName); - $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]'); - try { - $gapicClient->deleteConversationProfile($formattedName); - // 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]'); - $response = $gapicClient->getConversationProfile($formattedName); - $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]'); - try { - $gapicClient->getConversationProfile($formattedName); - // 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]'); - $response = $gapicClient->listConversationProfiles($formattedParent); - $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]'); - try { - $gapicClient->listConversationProfiles($formattedParent); - // 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(); - $response = $gapicClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); - $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(); - $response = $gapicClient->setSuggestionFeatureConfig($conversationProfile, $participantRole, $suggestionFeatureConfig); - $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(); - $response = $gapicClient->updateConversationProfile($conversationProfile, $updateMask); - $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(); - try { - $gapicClient->updateConversationProfile($conversationProfile, $updateMask); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php deleted file mode 100644 index 628731b7dd5d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php +++ /dev/null @@ -1,660 +0,0 @@ -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]'); - $response = $gapicClient->completeConversation($formattedName); - $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]'); - try { - $gapicClient->completeConversation($formattedName); - // 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); - $response = $gapicClient->createConversation($formattedParent, $conversation); - $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); - try { - $gapicClient->createConversation($formattedParent, $conversation); - // 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); - $response = $gapicClient->generateStatelessSummary($statelessConversation, $conversationProfile); - $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); - try { - $gapicClient->generateStatelessSummary($statelessConversation, $conversationProfile); - // 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]'); - $response = $gapicClient->getConversation($formattedName); - $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]'); - try { - $gapicClient->getConversation($formattedName); - // 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]'); - $response = $gapicClient->listConversations($formattedParent); - $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]'); - try { - $gapicClient->listConversations($formattedParent); - // 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]'); - $response = $gapicClient->listMessages($formattedParent); - $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]'); - try { - $gapicClient->listMessages($formattedParent); - // 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]'); - $response = $gapicClient->suggestConversationSummary($formattedConversation); - $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]'); - try { - $gapicClient->suggestConversationSummary($formattedConversation); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php deleted file mode 100644 index 51ffa88cba99..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/DocumentsClientTest.php +++ /dev/null @@ -1,1109 +0,0 @@ -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); - $response = $gapicClient->createDocument($formattedParent, $document); - $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); - $response = $gapicClient->createDocument($formattedParent, $document); - $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]'); - $response = $gapicClient->deleteDocument($formattedName); - $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]'); - $response = $gapicClient->deleteDocument($formattedName); - $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]'); - $response = $gapicClient->exportDocument($formattedName); - $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]'); - $response = $gapicClient->exportDocument($formattedName); - $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]'); - $response = $gapicClient->getDocument($formattedName); - $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]'); - try { - $gapicClient->getDocument($formattedName); - // 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); - $response = $gapicClient->importDocuments($formattedParent, $documentTemplate); - $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); - $response = $gapicClient->importDocuments($formattedParent, $documentTemplate); - $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]'); - $response = $gapicClient->listDocuments($formattedParent); - $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]'); - try { - $gapicClient->listDocuments($formattedParent); - // 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]'); - $response = $gapicClient->reloadDocument($formattedName); - $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]'); - $response = $gapicClient->reloadDocument($formattedName); - $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); - $response = $gapicClient->updateDocument($document); - $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); - $response = $gapicClient->updateDocument($document); - $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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php deleted file mode 100644 index fe5f669b489e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EntityTypesClientTest.php +++ /dev/null @@ -1,1129 +0,0 @@ -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 = []; - $response = $gapicClient->batchCreateEntities($formattedParent, $entities); - $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 = []; - $response = $gapicClient->batchCreateEntities($formattedParent, $entities); - $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 = []; - $response = $gapicClient->batchDeleteEntities($formattedParent, $entityValues); - $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 = []; - $response = $gapicClient->batchDeleteEntities($formattedParent, $entityValues); - $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 = []; - $response = $gapicClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); - $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 = []; - $response = $gapicClient->batchDeleteEntityTypes($formattedParent, $entityTypeNames); - $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 = []; - $response = $gapicClient->batchUpdateEntities($formattedParent, $entities); - $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 = []; - $response = $gapicClient->batchUpdateEntities($formattedParent, $entities); - $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]'); - $response = $gapicClient->batchUpdateEntityTypes($formattedParent); - $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]'); - $response = $gapicClient->batchUpdateEntityTypes($formattedParent); - $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); - $response = $gapicClient->createEntityType($formattedParent, $entityType); - $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); - try { - $gapicClient->createEntityType($formattedParent, $entityType); - // 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]'); - $gapicClient->deleteEntityType($formattedName); - $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]'); - try { - $gapicClient->deleteEntityType($formattedName); - // 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]'); - $response = $gapicClient->getEntityType($formattedName); - $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]'); - try { - $gapicClient->getEntityType($formattedName); - // 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]'); - $response = $gapicClient->listEntityTypes($formattedParent); - $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]'); - try { - $gapicClient->listEntityTypes($formattedParent); - // 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); - $response = $gapicClient->updateEntityType($entityType); - $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); - try { - $gapicClient->updateEntityType($entityType); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php deleted file mode 100644 index 82413ceeb063..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EnvironmentsClientTest.php +++ /dev/null @@ -1,587 +0,0 @@ -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'; - $response = $gapicClient->createEnvironment($formattedParent, $environment, $environmentId); - $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'; - try { - $gapicClient->createEnvironment($formattedParent, $environment, $environmentId); - // 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]'); - $gapicClient->deleteEnvironment($formattedName); - $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]'); - try { - $gapicClient->deleteEnvironment($formattedName); - // 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]'); - $response = $gapicClient->getEnvironment($formattedName); - $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]'); - try { - $gapicClient->getEnvironment($formattedName); - // 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]'); - $response = $gapicClient->getEnvironmentHistory($formattedParent); - $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]'); - try { - $gapicClient->getEnvironmentHistory($formattedParent); - // 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]'); - $response = $gapicClient->listEnvironments($formattedParent); - $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]'); - try { - $gapicClient->listEnvironments($formattedParent); - // 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(); - $response = $gapicClient->updateEnvironment($environment, $updateMask); - $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(); - try { - $gapicClient->updateEnvironment($environment, $updateMask); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php deleted file mode 100644 index 7a9fdc6fd390..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/FulfillmentsClientTest.php +++ /dev/null @@ -1,320 +0,0 @@ -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]'); - $response = $gapicClient->getFulfillment($formattedName); - $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]'); - try { - $gapicClient->getFulfillment($formattedName); - // 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(); - $response = $gapicClient->updateFulfillment($fulfillment, $updateMask); - $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(); - try { - $gapicClient->updateFulfillment($fulfillment, $updateMask); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php deleted file mode 100644 index 6ed657d29084..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/IntentsClientTest.php +++ /dev/null @@ -1,805 +0,0 @@ -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 = []; - $response = $gapicClient->batchDeleteIntents($formattedParent, $intents); - $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 = []; - $response = $gapicClient->batchDeleteIntents($formattedParent, $intents); - $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]'); - $response = $gapicClient->batchUpdateIntents($formattedParent); - $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]'); - $response = $gapicClient->batchUpdateIntents($formattedParent); - $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); - $response = $gapicClient->createIntent($formattedParent, $intent); - $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); - try { - $gapicClient->createIntent($formattedParent, $intent); - // 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]'); - $gapicClient->deleteIntent($formattedName); - $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]'); - try { - $gapicClient->deleteIntent($formattedName); - // 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]'); - $response = $gapicClient->getIntent($formattedName); - $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]'); - try { - $gapicClient->getIntent($formattedName); - // 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]'); - $response = $gapicClient->listIntents($formattedParent); - $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]'); - try { - $gapicClient->listIntents($formattedParent); - // 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); - $response = $gapicClient->updateIntent($intent); - $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); - try { - $gapicClient->updateIntent($intent); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php deleted file mode 100644 index 3169e40de146..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/KnowledgeBasesClientTest.php +++ /dev/null @@ -1,514 +0,0 @@ -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); - $response = $gapicClient->createKnowledgeBase($formattedParent, $knowledgeBase); - $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); - try { - $gapicClient->createKnowledgeBase($formattedParent, $knowledgeBase); - // 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]'); - $gapicClient->deleteKnowledgeBase($formattedName); - $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]'); - try { - $gapicClient->deleteKnowledgeBase($formattedName); - // 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]'); - $response = $gapicClient->getKnowledgeBase($formattedName); - $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]'); - try { - $gapicClient->getKnowledgeBase($formattedName); - // 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]'); - $response = $gapicClient->listKnowledgeBases($formattedParent); - $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]'); - try { - $gapicClient->listKnowledgeBases($formattedParent); - // 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); - $response = $gapicClient->updateKnowledgeBase($knowledgeBase); - $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); - try { - $gapicClient->updateKnowledgeBase($knowledgeBase); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php deleted file mode 100644 index 743e23e02211..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php +++ /dev/null @@ -1,806 +0,0 @@ -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]'); - $response = $gapicClient->analyzeContent($formattedParticipant); - $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]'); - try { - $gapicClient->analyzeContent($formattedParticipant); - // 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(); - $response = $gapicClient->createParticipant($formattedParent, $participant); - $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(); - try { - $gapicClient->createParticipant($formattedParent, $participant); - // 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]'); - $response = $gapicClient->getParticipant($formattedName); - $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]'); - try { - $gapicClient->getParticipant($formattedName); - // 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]'); - $response = $gapicClient->listParticipants($formattedParent); - $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]'); - try { - $gapicClient->listParticipants($formattedParent); - // 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'; - $expectedResponse = new StreamingAnalyzeContentResponse(); - $expectedResponse->setReplyText($replyText); - $transport->addResponse($expectedResponse); - $replyText2 = 'replyText2518940821'; - $expectedResponse2 = new StreamingAnalyzeContentResponse(); - $expectedResponse2->setReplyText($replyText2); - $transport->addResponse($expectedResponse2); - $replyText3 = 'replyText3518940822'; - $expectedResponse3 = new StreamingAnalyzeContentResponse(); - $expectedResponse3->setReplyText($replyText3); - $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]'); - $response = $gapicClient->suggestArticles($formattedParent); - $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]'); - try { - $gapicClient->suggestArticles($formattedParent); - // 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]'); - $response = $gapicClient->suggestFaqAnswers($formattedParent); - $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]'); - try { - $gapicClient->suggestFaqAnswers($formattedParent); - // 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]'); - $response = $gapicClient->suggestSmartReplies($formattedParent); - $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]'); - try { - $gapicClient->suggestSmartReplies($formattedParent); - // 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(); - $response = $gapicClient->updateParticipant($participant, $updateMask); - $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(); - try { - $gapicClient->updateParticipant($participant, $updateMask); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php deleted file mode 100644 index 66fa4a84a586..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionEntityTypesClientTest.php +++ /dev/null @@ -1,519 +0,0 @@ -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); - $response = $gapicClient->createSessionEntityType($formattedParent, $sessionEntityType); - $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); - try { - $gapicClient->createSessionEntityType($formattedParent, $sessionEntityType); - // 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]'); - $gapicClient->deleteSessionEntityType($formattedName); - $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]'); - try { - $gapicClient->deleteSessionEntityType($formattedName); - // 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]'); - $response = $gapicClient->getSessionEntityType($formattedName); - $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]'); - try { - $gapicClient->getSessionEntityType($formattedName); - // 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]'); - $response = $gapicClient->listSessionEntityTypes($formattedParent); - $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]'); - try { - $gapicClient->listSessionEntityTypes($formattedParent); - // 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); - $response = $gapicClient->updateSessionEntityType($sessionEntityType); - $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); - try { - $gapicClient->updateSessionEntityType($sessionEntityType); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php deleted file mode 100644 index d8b818a6bb74..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/SessionsClientTest.php +++ /dev/null @@ -1,365 +0,0 @@ -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(); - $response = $gapicClient->detectIntent($formattedSession, $queryInput); - $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(); - try { - $gapicClient->detectIntent($formattedSession, $queryInput); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php deleted file mode 100644 index 004f7d2889c4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/VersionsClientTest.php +++ /dev/null @@ -1,511 +0,0 @@ -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(); - $response = $gapicClient->createVersion($formattedParent, $version); - $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(); - try { - $gapicClient->createVersion($formattedParent, $version); - // 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]'); - $gapicClient->deleteVersion($formattedName); - $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]'); - try { - $gapicClient->deleteVersion($formattedName); - // 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]'); - $response = $gapicClient->getVersion($formattedName); - $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]'); - try { - $gapicClient->getVersion($formattedName); - // 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]'); - $response = $gapicClient->listVersions($formattedParent); - $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]'); - try { - $gapicClient->listVersions($formattedParent); - // 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(); - $response = $gapicClient->updateVersion($version, $updateMask); - $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(); - try { - $gapicClient->updateVersion($version, $updateMask); - // 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); - $response = $gapicClient->getLocation(); - $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); - try { - $gapicClient->getLocation(); - // 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); - $response = $gapicClient->listLocations(); - $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); - try { - $gapicClient->listLocations(); - // 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()); - } -}